Skip to content

Commit 3ff2e73

Browse files
committed
fixup: update flagd-schemas to json-schema-v0.2.14
1 parent ffda346 commit 3ff2e73

File tree

3 files changed

+16
-9
lines changed

3 files changed

+16
-9
lines changed

providers/flagd/schemas

tools/flagd-core/schemas

tools/flagd-core/src/main/resources/flagd/schemas/targeting.json

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"type": "string"
3636
},
3737
{
38-
"description": "When returned from rules, strings are used to as keys to retrieve the associated value from the \"variants\" object. Be sure that the returned string is present as a key in the variants!.",
38+
"description": "When returned from rules, the behavior of arrays is not defined.",
3939
"type": "array"
4040
}
4141
]
@@ -461,18 +461,25 @@
461461
"maxItems": 2,
462462
"items": [
463463
{
464-
"description": "If this bucket is randomly selected, this string is used to as a key to retrieve the associated value from the \"variants\" object.",
465-
"type": "string"
464+
"description": "If this bucket is randomly selected, this JSONLogic will be evaluated, and the result will be used as the variant key to return from the variants map.",
465+
"$ref": "#/definitions/args"
466466
},
467467
{
468-
"description": "Weighted distribution for this variant key.",
469-
"type": "number"
468+
"description": "Weighted distribution for this variant key. Must be an integer. Can be a JSONLogic expression that evaluates to a number (e.g. for time-based progressive rollouts).",
469+
"oneOf": [
470+
{
471+
"type": "integer"
472+
},
473+
{
474+
"$ref": "#/definitions/anyRule"
475+
}
476+
]
470477
}
471478
]
472479
},
473480
"fractionalOp": {
474481
"type": "array",
475-
"minItems": 3,
482+
"minItems": 1,
476483
"$comment": "there seems to be a bug here, where ajv gives a warning (not an error) because maxItems doesn't equal the number of entries in items, though this is valid in this case",
477484
"items": [
478485
{
@@ -492,7 +499,7 @@
492499
},
493500
"fractionalShorthandOp": {
494501
"type": "array",
495-
"minItems": 2,
502+
"minItems": 1,
496503
"items": {
497504
"$ref": "#/definitions/fractionalWeightArg"
498505
}

0 commit comments

Comments
 (0)