Skip to content

Commit 06584a7

Browse files
authored
chore: update public schema (#1284)
Update publicly served schema (flagd.dev) Specifically this supports [enhancements](#1266) from @colebaileygit Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
1 parent 584a469 commit 06584a7

File tree

1 file changed

+9
-22
lines changed

1 file changed

+9
-22
lines changed

docs/schema/v0/targeting.json

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -133,22 +133,6 @@
133133
}
134134
}
135135
},
136-
"ifRule": {
137-
"type": "object",
138-
"additionalProperties": false,
139-
"properties": {
140-
"if": {
141-
"title": "If Operator",
142-
"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.",
143-
"type": "array",
144-
"minItems": 1,
145-
"maxItems": 3,
146-
"items": {
147-
"$ref": "#/$defs/args"
148-
}
149-
}
150-
}
151-
},
152136
"binaryOrTernaryOp": {
153137
"type": "array",
154138
"minItems": 2,
@@ -190,6 +174,11 @@
190174
"type": "object",
191175
"additionalProperties": false,
192176
"properties": {
177+
"if": {
178+
"title": "If Operator",
179+
"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.",
180+
"$ref": "#/$defs/variadicOp"
181+
},
193182
"==": {
194183
"title": "Lose Equality Operation",
195184
"description": "Tests equality, with type coercion. Requires two arguments.",
@@ -486,7 +475,7 @@
486475
"items": [
487476
{
488477
"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.",
489-
"$ref": "#/$defs/varRule"
478+
"$ref": "#/$defs/anyRule"
490479
},
491480
{
492481
"$ref": "#/$defs/fractionalWeightArg"
@@ -527,8 +516,9 @@
527516
"reference": {
528517
"additionalProperties": false,
529518
"type": "object",
530-
"properties": {
531-
"$ref": {
519+
"$comment": "patternProperties here is a bit of a hack to prevent this definition from being dereferenced early.",
520+
"patternProperties": {
521+
"^\\$ref$": {
532522
"title": "Reference",
533523
"description": "A reference to another entity, used for $evaluators (shared rules).",
534524
"type": "string"
@@ -559,9 +549,6 @@
559549
{
560550
"$ref": "#/$defs/missingSomeRule"
561551
},
562-
{
563-
"$ref": "#/$defs/ifRule"
564-
},
565552
{
566553
"$ref": "#/$defs/binaryRule"
567554
},

0 commit comments

Comments
 (0)