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
"description": "Defines flags for use in flagd, including typed variants and rules",
5
+
"type": "object",
6
+
"properties": {
7
+
"flags": {
8
+
"type": "object",
9
+
"$comment": "flag objects are one of the 4 flag types defined in $defs",
10
+
"additionalProperties": false,
11
+
"patternProperties": {
12
+
"^.{1,}$": {
13
+
"oneOf": [
14
+
{
15
+
"title": "Boolean flag",
16
+
"description": "A flag associated with boolean values",
17
+
"$ref": "#/$defs/booleanFlag"
18
+
},
19
+
{
20
+
"title": "String flag",
21
+
"description": "A flag associated with string values",
22
+
"$ref": "#/$defs/stringFlag"
23
+
},
24
+
{
25
+
"title": "Numeric flag",
26
+
"description": "A flag associated with numeric values",
27
+
"$ref": "#/$defs/numberFlag"
28
+
},
29
+
{
30
+
"title": "Object flag",
31
+
"description": "A flag associated with arbitrary object values",
32
+
"$ref": "#/$defs/objectFlag"
33
+
}
34
+
],
35
+
"unevaluatedProperties": false
36
+
}
37
+
}
38
+
}
39
+
},
40
+
"$defs": {
41
+
"flag": {
42
+
"title": "Flag base",
43
+
"description": "Base object for all flags",
44
+
"properties": {
45
+
"state": {
46
+
"title:": "Flag state",
47
+
"description": "Indicates whether the flag is functional. Disabled flags are treated as if they don't exist",
48
+
"type": "string",
49
+
"enum": [
50
+
"ENABLED",
51
+
"DISABLED"
52
+
]
53
+
},
54
+
"defaultVariant": {
55
+
"title": "Default variant",
56
+
"description": "The variant to serve if no dynamic targeting applies",
57
+
"type": "string"
58
+
},
59
+
"targeting": {
60
+
"type": "object",
61
+
"title": "Targeting Logic",
62
+
"description": "JsonLogic expressions to be used for dynamic evaluation. The \"context\" is passed as the data. Rules must resolve one of the defined variants, or the \"defaultVariant\" will be used."
63
+
}
64
+
},
65
+
"required": [
66
+
"state",
67
+
"defaultVariant"
68
+
]
69
+
},
70
+
"booleanVariants": {
71
+
"type": "object",
72
+
"properties": {
73
+
"variants": {
74
+
"additionalProperties": false,
75
+
"patternProperties": {
76
+
"^.{1,}$": {
77
+
"type": "boolean"
78
+
}
79
+
},
80
+
"default": {
81
+
"on": true,
82
+
"off": false
83
+
}
84
+
}
85
+
}
86
+
},
87
+
"stringVariants": {
88
+
"type": "object",
89
+
"properties": {
90
+
"variants": {
91
+
"additionalProperties": false,
92
+
"patternProperties": {
93
+
"^.{1,}$": {
94
+
"type": "string"
95
+
}
96
+
}
97
+
}
98
+
}
99
+
},
100
+
"numberVariants": {
101
+
"type": "object",
102
+
"properties": {
103
+
"variants": {
104
+
"additionalProperties": false,
105
+
"patternProperties": {
106
+
"^.{1,}$": {
107
+
"type": "number"
108
+
}
109
+
}
110
+
}
111
+
}
112
+
},
113
+
"objectVariants": {
114
+
"type": "object",
115
+
"properties": {
116
+
"variants": {
117
+
"additionalProperties": false,
118
+
"patternProperties": {
119
+
"^.{1,}$": {
120
+
"type": "object"
121
+
}
122
+
}
123
+
}
124
+
}
125
+
},
126
+
"$comment": "Merge the variants with the base flag to build our typed flags",
0 commit comments