diff --git a/docs/schema/v0/targeting.json b/docs/schema/v0/targeting.json index 1b58ece94..0799285a0 100644 --- a/docs/schema/v0/targeting.json +++ b/docs/schema/v0/targeting.json @@ -133,22 +133,6 @@ } } }, - "ifRule": { - "type": "object", - "additionalProperties": false, - "properties": { - "if": { - "title": "If Operator", - "description": "The if statement takes 1-3 arguments: a condition (\"if\"), what to do if its true (\"then\", optional, defaults to returning true), and what to do if its false (\"else\", optional, defaults to returning false). Note that the form accepting more than 3 arguments (else-if) is not supported in flagd; use nesting instead.", - "type": "array", - "minItems": 1, - "maxItems": 3, - "items": { - "$ref": "#/$defs/args" - } - } - } - }, "binaryOrTernaryOp": { "type": "array", "minItems": 2, @@ -190,6 +174,11 @@ "type": "object", "additionalProperties": false, "properties": { + "if": { + "title": "If Operator", + "description": "The if statement takes 1 or more arguments: a condition (\"if\"), what to do if its true (\"then\", optional, defaults to returning true), and what to do if its false (\"else\", optional, defaults to returning false). Note that the else condition can be used as an else-if statement by adding additional arguments.", + "$ref": "#/$defs/variadicOp" + }, "==": { "title": "Lose Equality Operation", "description": "Tests equality, with type coercion. Requires two arguments.", @@ -486,7 +475,7 @@ "items": [ { "description": "Bucketing value used in pseudorandom assignment; should be unique and stable for each subject of flag evaluation. Defaults to a concatenation of the flagKey and targetingKey.", - "$ref": "#/$defs/varRule" + "$ref": "#/$defs/anyRule" }, { "$ref": "#/$defs/fractionalWeightArg" @@ -527,8 +516,9 @@ "reference": { "additionalProperties": false, "type": "object", - "properties": { - "$ref": { + "$comment": "patternProperties here is a bit of a hack to prevent this definition from being dereferenced early.", + "patternProperties": { + "^\\$ref$": { "title": "Reference", "description": "A reference to another entity, used for $evaluators (shared rules).", "type": "string" @@ -559,9 +549,6 @@ { "$ref": "#/$defs/missingSomeRule" }, - { - "$ref": "#/$defs/ifRule" - }, { "$ref": "#/$defs/binaryRule" },