You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR does 2 things:
- Allows for fractional targeting shorthand where no weight (assumes
weight = 1)
- Allows the targeting.json schema to be used alone, not just as part of
the flag definition schema
Non functionally, it restructures our testing so that tests pertaining
to `targeting.json` exist in the `test/targeting/` dir, while tests
pertaining to the `flags.json` exist in the `test/flags` dir.
Fixes: #165
---------
Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
"description": "Defines targeting logic for flagd; a extension of JSONLogic, including purpose-built feature-flagging operations.",
5
+
"description": "Defines targeting logic for flagd; a extension of JSONLogic, including purpose-built feature-flagging operations. Note that this schema applies to top-level objects; no additional properties are supported, including \"$schema\", which means built-in JSON-schema support is not possible in editors. Please use flags.json (which imports this schema) for a rich editor experience.",
6
6
"type": "object",
7
-
"definitions": {
8
-
"targeting": {
9
-
"title": "Targeting",
10
-
"description": "An expression returning a value which is coerced to a string to be used as a targeting key, or null (to fall back to defaultVariant). If targeting returns a value which is not a variant key, it's considered an error.",
11
-
"anyOf": [
12
-
{
13
-
"$comment": "we need this to support empty targeting",
14
-
"type": "object",
15
-
"additionalProperties": false,
16
-
"properties": {}
17
-
},
18
-
{
19
-
"$ref": "#/definitions/anyRule"
20
-
}
21
-
]
7
+
"anyOf": [
8
+
{
9
+
"$comment": "we need this to support empty targeting",
10
+
"type": "object",
11
+
"additionalProperties": false,
12
+
"properties": {}
22
13
},
14
+
{
15
+
"$ref": "#/definitions/anyRule"
16
+
}
17
+
],
18
+
"definitions": {
23
19
"primitive": {
24
20
"oneOf": [
25
21
{
@@ -462,7 +458,7 @@
462
458
"$comment": "if we remove the \"sum to 100\" restriction, update the descriptions below!",
463
459
"description": "Distribution for all possible variants, with their associated weighting out of 100.",
0 commit comments