-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsplit-feature-flag-definition-schema.json
More file actions
254 lines (254 loc) · 7.82 KB
/
Copy pathsplit-feature-flag-definition-schema.json
File metadata and controls
254 lines (254 loc) · 7.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://split.io/schemas/split/feature-flag-definition.json",
"title": "Split Feature Flag Definition",
"description": "The complete targeting definition of a feature flag within a specific environment, including treatments, targeting rules, percentage-based rollouts, and kill status.",
"type": "object",
"required": ["name", "treatments", "defaultTreatment", "defaultRule"],
"properties": {
"name": {
"type": "string",
"description": "Name of the feature flag this definition belongs to"
},
"environment": {
"$ref": "#/$defs/EnvironmentRef"
},
"trafficType": {
"$ref": "#/$defs/TrafficType"
},
"killed": {
"type": "boolean",
"description": "Whether the flag is killed, forcing all evaluations to return the default treatment"
},
"treatments": {
"type": "array",
"description": "List of possible treatments that this feature flag can return during evaluation",
"minItems": 1,
"items": {
"$ref": "#/$defs/Treatment"
}
},
"defaultTreatment": {
"type": "string",
"description": "The treatment returned when no targeting rules match or when the flag is killed"
},
"baselineTreatment": {
"type": "string",
"description": "The control treatment used as a baseline for experimentation comparisons"
},
"rules": {
"type": "array",
"description": "Ordered list of targeting rules evaluated top to bottom; the first matching rule determines the treatment",
"items": {
"$ref": "#/$defs/TargetingRule"
}
},
"defaultRule": {
"type": "array",
"description": "The default percentage-based rollout applied when no targeting rules match",
"items": {
"$ref": "#/$defs/Bucket"
}
},
"trafficAllocation": {
"type": "integer",
"description": "Percentage of traffic included in feature flag evaluation (0-100)",
"minimum": 0,
"maximum": 100
},
"lastModified": {
"type": "integer",
"description": "Unix timestamp of the last modification to this definition"
},
"creationTime": {
"type": "integer",
"description": "Unix timestamp of when this definition was created"
}
},
"$defs": {
"EnvironmentRef": {
"type": "object",
"description": "A reference to the environment where this definition is active",
"properties": {
"id": {
"type": "string",
"description": "Unique identifier of the environment"
},
"name": {
"type": "string",
"description": "Name of the environment"
}
}
},
"TrafficType": {
"type": "object",
"description": "A traffic type defining the kind of entity that feature flags target",
"properties": {
"id": {
"type": "string",
"description": "Unique identifier for the traffic type"
},
"name": {
"type": "string",
"description": "Name of the traffic type"
}
}
},
"Treatment": {
"type": "object",
"description": "A treatment representing one of the possible values returned by a feature flag evaluation",
"required": ["name"],
"properties": {
"name": {
"type": "string",
"description": "Name of the treatment (e.g., on, off, v1, v2)"
},
"description": {
"type": "string",
"description": "Description of what this treatment does"
},
"configurations": {
"type": "string",
"description": "JSON string containing dynamic configuration associated with this treatment"
}
}
},
"TargetingRule": {
"type": "object",
"description": "A targeting rule that matches specific conditions and assigns treatments to matching traffic",
"required": ["condition", "buckets"],
"properties": {
"condition": {
"$ref": "#/$defs/Condition"
},
"buckets": {
"type": "array",
"description": "Percentage-based distribution of treatments for traffic matching this rule",
"items": {
"$ref": "#/$defs/Bucket"
}
}
}
},
"Condition": {
"type": "object",
"description": "A condition defining the matching criteria for a targeting rule",
"properties": {
"combiner": {
"type": "string",
"description": "Logical combiner for multiple matchers within this condition",
"enum": ["AND"]
},
"matchers": {
"type": "array",
"description": "List of matchers that define the matching criteria",
"items": {
"$ref": "#/$defs/Matcher"
}
}
}
},
"Matcher": {
"type": "object",
"description": "A matcher defining a single matching criterion based on attributes, segments, or key values",
"required": ["type"],
"properties": {
"type": {
"type": "string",
"description": "Type of matching to perform",
"enum": [
"IN_SEGMENT",
"WHITELIST",
"ALL_KEYS",
"EQUAL_TO",
"GREATER_THAN_OR_EQUAL_TO",
"LESS_THAN_OR_EQUAL_TO",
"BETWEEN",
"CONTAINS_STRING",
"STARTS_WITH",
"ENDS_WITH",
"MATCHES_STRING",
"IN_LIST_STRING",
"EQUAL_TO_SET",
"CONTAINS_ALL_OF_SET",
"CONTAINS_ANY_OF_SET",
"PART_OF_SET",
"EQUAL_TO_BOOLEAN",
"DEPENDS_ON"
]
},
"negate": {
"type": "boolean",
"description": "Whether to negate the matcher result"
},
"attribute": {
"type": "string",
"description": "The attribute name to match against"
},
"strings": {
"type": "array",
"description": "String values used by string-based matchers",
"items": {
"type": "string"
}
},
"number": {
"type": "integer",
"description": "Numeric value used by numeric matchers"
},
"date": {
"type": "integer",
"description": "Unix timestamp value used by date-based matchers"
},
"between": {
"type": "object",
"description": "Range values for the BETWEEN matcher",
"properties": {
"from": {
"type": "integer",
"description": "Lower bound of the range"
},
"to": {
"type": "integer",
"description": "Upper bound of the range"
}
}
},
"depends": {
"type": "object",
"description": "Dependency configuration for the DEPENDS_ON matcher",
"properties": {
"splitName": {
"type": "string",
"description": "Name of the feature flag to depend on"
},
"treatments": {
"type": "array",
"description": "Treatments that must be returned by the dependency",
"items": {
"type": "string"
}
}
}
}
}
},
"Bucket": {
"type": "object",
"description": "A bucket defining the percentage of traffic assigned to a specific treatment",
"required": ["treatment", "size"],
"properties": {
"treatment": {
"type": "string",
"description": "Name of the treatment assigned to this bucket"
},
"size": {
"type": "integer",
"description": "Percentage of traffic allocated to this bucket (0-100)",
"minimum": 0,
"maximum": 100
}
}
}
}
}