@featurevisor/core 2.16.0 → 2.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/coverage/clover.xml +798 -764
  3. package/coverage/coverage-final.json +5 -5
  4. package/coverage/lcov-report/builder/allocator.ts.html +1 -1
  5. package/coverage/lcov-report/builder/buildScopedConditions.ts.html +1 -1
  6. package/coverage/lcov-report/builder/buildScopedDatafile.ts.html +1 -1
  7. package/coverage/lcov-report/builder/buildScopedSegments.ts.html +1 -1
  8. package/coverage/lcov-report/builder/index.html +1 -1
  9. package/coverage/lcov-report/builder/mutateVariables.ts.html +1 -1
  10. package/coverage/lcov-report/builder/mutator.ts.html +18 -18
  11. package/coverage/lcov-report/builder/revision.ts.html +1 -1
  12. package/coverage/lcov-report/builder/traffic.ts.html +1 -1
  13. package/coverage/lcov-report/config/index.html +1 -1
  14. package/coverage/lcov-report/config/index.ts.html +1 -1
  15. package/coverage/lcov-report/config/projectConfig.ts.html +1 -1
  16. package/coverage/lcov-report/datasource/adapter.ts.html +1 -1
  17. package/coverage/lcov-report/datasource/datasource.ts.html +1 -1
  18. package/coverage/lcov-report/datasource/filesystemAdapter.ts.html +1 -1
  19. package/coverage/lcov-report/datasource/index.html +1 -1
  20. package/coverage/lcov-report/datasource/index.ts.html +1 -1
  21. package/coverage/lcov-report/index.html +18 -18
  22. package/coverage/lcov-report/linter/attributeSchema.ts.html +1 -1
  23. package/coverage/lcov-report/linter/checkCircularDependency.ts.html +1 -1
  24. package/coverage/lcov-report/linter/checkPercentageExceedingSlot.ts.html +1 -1
  25. package/coverage/lcov-report/linter/conditionSchema.ts.html +7 -7
  26. package/coverage/lcov-report/linter/featureSchema.ts.html +365 -188
  27. package/coverage/lcov-report/linter/groupSchema.ts.html +1 -1
  28. package/coverage/lcov-report/linter/index.html +34 -34
  29. package/coverage/lcov-report/linter/lintProject.ts.html +1 -1
  30. package/coverage/lcov-report/linter/mutationNotation.ts.html +99 -66
  31. package/coverage/lcov-report/linter/printError.ts.html +1 -1
  32. package/coverage/lcov-report/linter/schema.ts.html +170 -80
  33. package/coverage/lcov-report/linter/segmentSchema.ts.html +1 -1
  34. package/coverage/lcov-report/linter/testSchema.ts.html +1 -1
  35. package/coverage/lcov-report/list/index.html +1 -1
  36. package/coverage/lcov-report/list/matrix.ts.html +1 -1
  37. package/coverage/lcov-report/parsers/index.html +1 -1
  38. package/coverage/lcov-report/parsers/index.ts.html +1 -1
  39. package/coverage/lcov-report/parsers/json.ts.html +1 -1
  40. package/coverage/lcov-report/parsers/yml.ts.html +1 -1
  41. package/coverage/lcov-report/tester/cliFormat.ts.html +1 -1
  42. package/coverage/lcov-report/tester/helpers.ts.html +1 -1
  43. package/coverage/lcov-report/tester/index.html +1 -1
  44. package/coverage/lcov-report/utils/git.ts.html +1 -1
  45. package/coverage/lcov-report/utils/index.html +1 -1
  46. package/coverage/lcov.info +1653 -1567
  47. package/json-schema/attribute.json +25 -9
  48. package/json-schema/feature.json +319 -238
  49. package/json-schema/segment.json +76 -45
  50. package/lib/generate-code/typescript.js +118 -50
  51. package/lib/generate-code/typescript.js.map +1 -1
  52. package/lib/linter/featureSchema.d.ts +9 -0
  53. package/lib/linter/featureSchema.js +38 -8
  54. package/lib/linter/featureSchema.js.map +1 -1
  55. package/lib/linter/featureSchema.spec.js +93 -0
  56. package/lib/linter/featureSchema.spec.js.map +1 -1
  57. package/lib/linter/mutationNotation.js +21 -11
  58. package/lib/linter/mutationNotation.js.map +1 -1
  59. package/lib/linter/mutationNotation.spec.js +18 -0
  60. package/lib/linter/mutationNotation.spec.js.map +1 -1
  61. package/lib/linter/schema.d.ts +1 -0
  62. package/lib/linter/schema.js +13 -0
  63. package/lib/linter/schema.js.map +1 -1
  64. package/lib/linter/schema.spec.js +51 -0
  65. package/lib/linter/schema.spec.js.map +1 -1
  66. package/package.json +5 -5
  67. package/src/generate-code/typescript.ts +150 -52
  68. package/src/linter/featureSchema.spec.ts +118 -0
  69. package/src/linter/featureSchema.ts +65 -6
  70. package/src/linter/mutationNotation.spec.ts +23 -0
  71. package/src/linter/mutationNotation.ts +18 -7
  72. package/src/linter/schema.spec.ts +72 -0
  73. package/src/linter/schema.ts +30 -0
@@ -6,19 +6,35 @@
6
6
  "type": "boolean",
7
7
  "description": "Indicates whether the attribute is archived or not."
8
8
  },
9
- "description": {
9
+ "type": {
10
10
  "type": "string",
11
- "description": "Human readable description of the attribute for documentation purposes."
11
+ "description": "Type of attribute.",
12
+ "enum": ["boolean", "string", "integer", "double", "date", "semver", "object", "array"]
12
13
  },
13
- "type": {
14
+ "description": {
14
15
  "type": "string",
15
- "description": "Type of attribute. Allows values are: string, boolean, integer, and double."
16
+ "description": "Human readable description of the attribute for documentation purposes."
16
17
  },
17
- "capture": {
18
- "type": "boolean",
19
- "description": "Mark this attribute as one for capturing during feature activation."
18
+ "properties": {
19
+ "type": "object",
20
+ "description": "Optional property definitions for object attributes.",
21
+ "additionalProperties": {
22
+ "type": "object",
23
+ "properties": {
24
+ "type": {
25
+ "type": "string",
26
+ "enum": ["boolean", "string", "integer", "double", "date", "semver", "array"]
27
+ },
28
+ "description": {
29
+ "type": "string"
30
+ }
31
+ },
32
+ "required": ["type"],
33
+ "additionalProperties": false
34
+ }
20
35
  }
21
36
  },
22
- "description": "JSON Schema for creating Featurevisor attribute, expressed in YAML",
23
- "required": ["description", "type"]
37
+ "required": ["description", "type"],
38
+ "additionalProperties": false,
39
+ "description": "JSON Schema for creating Featurevisor attribute, expressed in YAML"
24
40
  }
@@ -1,177 +1,350 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
3
  "$defs": {
4
- "variation_value": {
5
- "anyOf": [
6
- {
7
- "type": "string"
8
- },
4
+ "value": {
5
+ "oneOf": [
6
+ { "type": "boolean" },
7
+ { "type": "string" },
8
+ { "type": "number" },
9
9
  {
10
- "type": "number"
10
+ "type": "object",
11
+ "additionalProperties": { "$ref": "#/$defs/value" }
11
12
  },
12
13
  {
13
- "type": "boolean"
14
+ "type": "array",
15
+ "items": { "$ref": "#/$defs/value" }
14
16
  }
15
17
  ]
16
18
  },
17
- "flat_object": {
18
- "type": "object",
19
- "additionalProperties": {
20
- "oneOf": [{ "type": "string" }, { "type": "boolean" }, { "type": "number" }]
21
- }
19
+ "value_or_null": {
20
+ "oneOf": [{ "$ref": "#/$defs/value" }, { "type": "null" }]
21
+ },
22
+ "variation_value": {
23
+ "type": "string",
24
+ "minLength": 1
22
25
  },
23
- "variable_value": {
24
- "anyOf": [
26
+ "group_segment": {
27
+ "oneOf": [
25
28
  {
26
- "type": "string"
29
+ "type": "string",
30
+ "description": "Segment key or *"
27
31
  },
28
32
  {
29
- "type": "number"
33
+ "type": "object",
34
+ "properties": {
35
+ "and": {
36
+ "type": "array",
37
+ "items": { "$ref": "#/$defs/group_segment" }
38
+ }
39
+ },
40
+ "required": ["and"],
41
+ "additionalProperties": false
30
42
  },
31
43
  {
32
- "type": "boolean"
44
+ "type": "object",
45
+ "properties": {
46
+ "or": {
47
+ "type": "array",
48
+ "items": { "$ref": "#/$defs/group_segment" }
49
+ }
50
+ },
51
+ "required": ["or"],
52
+ "additionalProperties": false
33
53
  },
54
+ {
55
+ "type": "object",
56
+ "properties": {
57
+ "not": {
58
+ "type": "array",
59
+ "items": { "$ref": "#/$defs/group_segment" }
60
+ }
61
+ },
62
+ "required": ["not"],
63
+ "additionalProperties": false
64
+ }
65
+ ]
66
+ },
67
+ "group_segments": {
68
+ "oneOf": [
69
+ { "$ref": "#/$defs/group_segment" },
34
70
  {
35
71
  "type": "array",
36
- "items": {
37
- "type": "string"
38
- }
72
+ "items": { "$ref": "#/$defs/group_segment" }
73
+ }
74
+ ]
75
+ },
76
+ "bucket_by": {
77
+ "oneOf": [
78
+ { "type": "string" },
79
+ {
80
+ "type": "array",
81
+ "items": { "type": "string" }
39
82
  },
40
83
  {
41
84
  "type": "object",
42
85
  "properties": {
43
- "key": {
44
- "$ref": "#/$defs/flat_object"
86
+ "or": {
87
+ "type": "array",
88
+ "items": { "type": "string" }
45
89
  }
46
- }
90
+ },
91
+ "required": ["or"],
92
+ "additionalProperties": false
47
93
  }
48
94
  ]
49
95
  },
50
- "variation": {
96
+ "required_dependency": {
97
+ "oneOf": [
98
+ { "type": "string" },
99
+ {
100
+ "type": "object",
101
+ "properties": {
102
+ "key": { "type": "string" },
103
+ "variation": { "type": "string" }
104
+ },
105
+ "required": ["key"],
106
+ "additionalProperties": false
107
+ }
108
+ ]
109
+ },
110
+ "schema_node": {
51
111
  "type": "object",
52
112
  "properties": {
53
- "description": {
113
+ "description": { "type": "string" },
114
+ "schema": { "type": "string" },
115
+ "type": {
54
116
  "type": "string",
55
- "description": "Human readable description of the variation for documentation purposes."
117
+ "enum": ["boolean", "string", "integer", "double", "object", "array"]
56
118
  },
57
- "value": {
58
- "$ref": "#/$defs/variation_value",
59
- "description": "Value of the variation."
119
+ "enum": {
120
+ "type": "array",
121
+ "items": { "$ref": "#/$defs/value" }
60
122
  },
61
- "weight": {
62
- "type": "number",
63
- "description": "Weight of the variation between 0 and 100 (inclusive).",
64
- "minimum": 0,
65
- "maximum": 100
123
+ "const": { "$ref": "#/$defs/value" },
124
+ "minimum": { "type": "number" },
125
+ "maximum": { "type": "number" },
126
+ "minLength": { "type": "number" },
127
+ "maxLength": { "type": "number" },
128
+ "pattern": { "type": "string" },
129
+ "items": { "$ref": "#/$defs/schema_node" },
130
+ "minItems": { "type": "number" },
131
+ "maxItems": { "type": "number" },
132
+ "uniqueItems": { "type": "boolean" },
133
+ "required": {
134
+ "type": "array",
135
+ "items": { "type": "string" }
66
136
  },
67
- "variables": {
137
+ "properties": {
138
+ "type": "object",
139
+ "additionalProperties": { "$ref": "#/$defs/schema_node" }
140
+ },
141
+ "additionalProperties": { "$ref": "#/$defs/schema_node" },
142
+ "oneOf": {
68
143
  "type": "array",
69
- "items": {
70
- "type": "object",
71
- "properties": {
72
- "deprecated": {
73
- "type": "boolean",
74
- "description": "Indicates whether the variable is deprecated or not."
75
- },
76
- "key": {
77
- "type": "string",
78
- "description": "Key of the variable."
79
- },
80
- "value": {
81
- "$ref": "#/$defs/variable_value",
82
- "description": "Value of the variable."
83
- },
84
- "overrides": {
85
- "type": "array",
86
- "items": {
87
- "type": "object",
88
- "properties": {
89
- "conditions": {
90
- "$ref": "segment.json#/$defs/multiple_conditions",
91
- "description": "Embedded conditions for overriding the variable"
92
- },
93
- "segments": {
94
- "$ref": "#/$defs/segments",
95
- "description": "Embedded conditions for overriding the variable"
96
- },
97
- "value": {
98
- "$ref": "#/$defs/variable_value",
99
- "description": "Value of the override."
100
- }
101
- },
102
- "required": ["value"]
103
- }
104
- }
105
- },
106
- "description": "Variables for the variation.",
107
- "required": ["key"]
108
- }
144
+ "items": { "$ref": "#/$defs/schema_node" }
109
145
  }
110
146
  },
111
- "description": "Variation for the feature.",
112
- "required": ["value"]
113
- },
114
- "segments": {
115
- "anyOf": [
116
- { "$ref": "#/$defs/segments_everyone" },
117
- { "$ref": "#/$defs/segments_multiple" },
118
- { "$ref": "#/$defs/segments_complex" },
119
- { "$ref": "#/$defs/segments_single" }
120
- ],
121
- "description": "Array of segment keys"
122
- },
123
- "segments_everyone": {
124
- "type": "string",
125
- "description": "Target everyone",
126
- "enum": ["*"]
127
- },
128
- "segments_single": {
129
- "type": "string",
130
- "description": "Target a specific segment"
147
+ "additionalProperties": false
131
148
  },
132
- "segments_complex": {
133
- "oneOf": [
134
- { "$ref": "#/$defs/segments_and" },
135
- { "$ref": "#/$defs/segments_or" },
136
- { "$ref": "#/$defs/segments_not" }
137
- ]
149
+ "variable_schema_entry": {
150
+ "type": "object",
151
+ "properties": {
152
+ "deprecated": { "type": "boolean" },
153
+ "schema": { "type": "string" },
154
+ "type": {
155
+ "type": "string",
156
+ "enum": ["json", "boolean", "string", "integer", "double", "object", "array"]
157
+ },
158
+ "items": { "$ref": "#/$defs/schema_node" },
159
+ "properties": {
160
+ "type": "object",
161
+ "additionalProperties": { "$ref": "#/$defs/schema_node" }
162
+ },
163
+ "additionalProperties": { "$ref": "#/$defs/schema_node" },
164
+ "required": {
165
+ "type": "array",
166
+ "items": { "type": "string" }
167
+ },
168
+ "enum": {
169
+ "type": "array",
170
+ "items": { "$ref": "#/$defs/value" }
171
+ },
172
+ "const": { "$ref": "#/$defs/value" },
173
+ "oneOf": {
174
+ "type": "array",
175
+ "items": { "$ref": "#/$defs/schema_node" }
176
+ },
177
+ "minimum": { "type": "number" },
178
+ "maximum": { "type": "number" },
179
+ "minLength": { "type": "number" },
180
+ "maxLength": { "type": "number" },
181
+ "pattern": { "type": "string" },
182
+ "minItems": { "type": "number" },
183
+ "maxItems": { "type": "number" },
184
+ "uniqueItems": { "type": "boolean" },
185
+ "description": { "type": "string" },
186
+ "defaultValue": { "$ref": "#/$defs/value" },
187
+ "disabledValue": { "$ref": "#/$defs/value" },
188
+ "useDefaultWhenDisabled": { "type": "boolean" }
189
+ },
190
+ "required": ["defaultValue"],
191
+ "additionalProperties": false
138
192
  },
139
- "segments_and": {
193
+ "variation_override": {
140
194
  "type": "object",
141
195
  "properties": {
142
- "and": {
143
- "$ref": "#/$defs/segments_multiple"
144
- }
196
+ "conditions": {
197
+ "oneOf": [
198
+ { "$ref": "segment.json#/$defs/multiple_conditions" },
199
+ { "$ref": "segment.json#/$defs/complex_condition" },
200
+ { "$ref": "segment.json#/$defs/plain_condition" }
201
+ ]
202
+ },
203
+ "segments": { "$ref": "#/$defs/group_segments" },
204
+ "value": { "$ref": "#/$defs/value" }
145
205
  },
146
- "description": "Target segments with 'and' operator.",
147
- "required": ["and"]
206
+ "required": ["value"],
207
+ "additionalProperties": false
148
208
  },
149
- "segments_or": {
209
+ "variation": {
150
210
  "type": "object",
151
211
  "properties": {
152
- "or": {
153
- "$ref": "#/$defs/segments_multiple"
212
+ "description": { "type": "string" },
213
+ "value": { "$ref": "#/$defs/variation_value" },
214
+ "weight": {
215
+ "type": "number",
216
+ "minimum": 0,
217
+ "maximum": 100
218
+ },
219
+ "variables": {
220
+ "type": "object",
221
+ "additionalProperties": { "$ref": "#/$defs/value_or_null" }
222
+ },
223
+ "variableOverrides": {
224
+ "type": "object",
225
+ "additionalProperties": {
226
+ "type": "array",
227
+ "items": { "$ref": "#/$defs/variation_override" }
228
+ }
154
229
  }
155
230
  },
156
- "description": "Target segments with 'or' operator.",
157
- "required": ["or"]
231
+ "required": ["value", "weight"],
232
+ "additionalProperties": false
158
233
  },
159
- "segments_not": {
234
+ "rule": {
160
235
  "type": "object",
161
236
  "properties": {
162
- "or": {
163
- "$ref": "#/$defs/segments_multiple"
237
+ "key": { "type": "string" },
238
+ "description": { "type": "string" },
239
+ "segments": { "$ref": "#/$defs/group_segments" },
240
+ "percentage": {
241
+ "type": "number",
242
+ "minimum": 0,
243
+ "maximum": 100
244
+ },
245
+ "enabled": { "type": "boolean" },
246
+ "variation": { "$ref": "#/$defs/variation_value" },
247
+ "variables": {
248
+ "type": "object",
249
+ "additionalProperties": { "$ref": "#/$defs/value_or_null" }
250
+ },
251
+ "variationWeights": {
252
+ "type": "object",
253
+ "additionalProperties": {
254
+ "type": "number",
255
+ "minimum": 0,
256
+ "maximum": 100
257
+ }
164
258
  }
165
259
  },
166
- "description": "Target segments with 'not' operator.",
167
- "required": ["not"]
260
+ "required": ["key", "segments", "percentage"],
261
+ "additionalProperties": false
168
262
  },
169
- "segments_multiple": {
170
- "type": "array",
171
- "items": {
172
- "oneOf": [{ "$ref": "#/$defs/segments_single" }, { "$ref": "#/$defs/segments_complex" }]
173
- },
174
- "description": "Target an array of segments"
263
+ "force_item": {
264
+ "oneOf": [
265
+ {
266
+ "type": "object",
267
+ "properties": {
268
+ "segments": { "$ref": "#/$defs/group_segments" },
269
+ "enabled": { "type": "boolean" },
270
+ "variation": { "$ref": "#/$defs/variation_value" },
271
+ "variables": {
272
+ "type": "object",
273
+ "additionalProperties": { "$ref": "#/$defs/value_or_null" }
274
+ }
275
+ },
276
+ "required": ["segments"],
277
+ "additionalProperties": false
278
+ },
279
+ {
280
+ "type": "object",
281
+ "properties": {
282
+ "conditions": {
283
+ "oneOf": [
284
+ { "$ref": "segment.json#/$defs/multiple_conditions" },
285
+ { "$ref": "segment.json#/$defs/complex_condition" },
286
+ { "$ref": "segment.json#/$defs/plain_condition" }
287
+ ]
288
+ },
289
+ "enabled": { "type": "boolean" },
290
+ "variation": { "$ref": "#/$defs/variation_value" },
291
+ "variables": {
292
+ "type": "object",
293
+ "additionalProperties": { "$ref": "#/$defs/value_or_null" }
294
+ }
295
+ },
296
+ "required": ["conditions"],
297
+ "additionalProperties": false
298
+ }
299
+ ]
300
+ },
301
+ "expose_value": {
302
+ "oneOf": [
303
+ { "type": "boolean" },
304
+ {
305
+ "type": "array",
306
+ "items": { "type": "string" }
307
+ }
308
+ ]
309
+ },
310
+ "rules_container": {
311
+ "oneOf": [
312
+ {
313
+ "type": "array",
314
+ "items": { "$ref": "#/$defs/rule" }
315
+ },
316
+ {
317
+ "type": "object",
318
+ "additionalProperties": {
319
+ "type": "array",
320
+ "items": { "$ref": "#/$defs/rule" }
321
+ }
322
+ }
323
+ ]
324
+ },
325
+ "force_container": {
326
+ "oneOf": [
327
+ {
328
+ "type": "array",
329
+ "items": { "$ref": "#/$defs/force_item" }
330
+ },
331
+ {
332
+ "type": "object",
333
+ "additionalProperties": {
334
+ "type": "array",
335
+ "items": { "$ref": "#/$defs/force_item" }
336
+ }
337
+ }
338
+ ]
339
+ },
340
+ "expose_container": {
341
+ "oneOf": [
342
+ { "$ref": "#/$defs/expose_value" },
343
+ {
344
+ "type": "object",
345
+ "additionalProperties": { "$ref": "#/$defs/expose_value" }
346
+ }
347
+ ]
175
348
  }
176
349
  },
177
350
  "type": "object",
@@ -180,134 +353,42 @@
180
353
  "type": "boolean",
181
354
  "description": "Indicates whether the feature is archived or not."
182
355
  },
356
+ "deprecated": {
357
+ "type": "boolean",
358
+ "description": "Indicates whether the feature is deprecated or not."
359
+ },
183
360
  "description": {
184
361
  "type": "string",
185
362
  "description": "Human readable description of the feature for documentation purposes."
186
363
  },
187
364
  "tags": {
188
365
  "type": "array",
189
- "items": {
190
- "type": "string"
191
- },
366
+ "items": { "type": "string" },
192
367
  "description": "Array of tags"
193
368
  },
194
- "defaultVariation": {
195
- "$ref": "#/$defs/variation_value",
196
- "description": "Default variation for the feature."
369
+ "required": {
370
+ "type": "array",
371
+ "items": { "$ref": "#/$defs/required_dependency" }
372
+ },
373
+ "bucketBy": {
374
+ "$ref": "#/$defs/bucket_by"
375
+ },
376
+ "disabledVariationValue": {
377
+ "$ref": "#/$defs/variation_value"
197
378
  },
198
379
  "variablesSchema": {
199
- "type": "array",
200
- "items": {
201
- "type": "object",
202
- "properties": {
203
- "key": {
204
- "type": "string",
205
- "description": "Key of the variable."
206
- },
207
- "type": {
208
- "type": "string",
209
- "description": "Type of this specific variable.",
210
- "enum": ["string", "boolean", "integer", "double", "json", "array", "object"]
211
- },
212
- "defaultValue": {
213
- "$ref": "#/$defs/variable_value",
214
- "description": "Default value for this specific variable."
215
- }
216
- },
217
- "description": "Schema for the feature's variables.",
218
- "required": ["type"]
219
- }
380
+ "type": "object",
381
+ "additionalProperties": { "$ref": "#/$defs/variable_schema_entry" }
220
382
  },
221
383
  "variations": {
222
384
  "type": "array",
223
- "items": {
224
- "$ref": "#/$defs/variation"
225
- },
226
- "description": "Array of variations for the feature."
385
+ "items": { "$ref": "#/$defs/variation" }
227
386
  },
228
- "environments": {
229
- "additionalProperties": {
230
- "type": "object",
231
- "properties": {
232
- "exposed": {
233
- "type": "boolean",
234
- "description": "Indicates whether the feature is exposed to the environment."
235
- },
236
- "rules": {
237
- "type": "array",
238
- "items": {
239
- "type": "object",
240
- "properties": {
241
- "key": {
242
- "type": "string",
243
- "description": "Unique key of the rule among its siblings."
244
- },
245
- "segments": {
246
- "$ref": "#/$defs/segments",
247
- "description": "Embedded conditions for the rule"
248
- },
249
- "percentage": {
250
- "type": "number",
251
- "description": "Percentage of the rule between 0 and 100 (inclusive).",
252
- "minimum": 0,
253
- "maximum": 100
254
- },
255
- "variation": {
256
- "$ref": "#/$defs/variation_value",
257
- "description": "Overriding variation value for this rule"
258
- },
259
- "variables": {
260
- "additionalProperties": {
261
- "$ref": "#/$defs/variable_value",
262
- "description": "Overriding variable value for this rule"
263
- }
264
- }
265
- }
266
- },
267
- "description": "Array of rules for the feature.",
268
- "required": ["key", "percentage", "segments"]
269
- },
270
- "force": {
271
- "type": "array",
272
- "items": {
273
- "type": "object",
274
- "properties": {
275
- "segments": {
276
- "$ref": "#/$defs/segments",
277
- "description": "Embedded segments"
278
- },
279
- "conditions": {
280
- "oneOf": [
281
- {
282
- "$ref": "segment.json#/$defs/multiple_conditions"
283
- },
284
- {
285
- "$ref": "segment.json#/$defs/complex_condition"
286
- },
287
- {
288
- "$ref": "segment.json#/$defs/plain_condition"
289
- }
290
- ]
291
- },
292
- "variation": {
293
- "$ref": "#/$defs/variation_value",
294
- "description": "Overriding variation value"
295
- },
296
- "variables": {
297
- "additionalProperties": {
298
- "$ref": "#/$defs/variable_value",
299
- "description": "Overriding variable value"
300
- }
301
- }
302
- }
303
- }
304
- }
305
- },
306
- "description": "Environment specific configuration for the feature.",
307
- "required": ["rules"]
308
- }
309
- }
387
+ "expose": { "$ref": "#/$defs/expose_container" },
388
+ "force": { "$ref": "#/$defs/force_container" },
389
+ "rules": { "$ref": "#/$defs/rules_container" }
310
390
  },
311
- "description": "JSON Schema for creating Featurevisor feature, expressed in YAML",
312
- "required": ["description", "tags"]
391
+ "required": ["description", "tags", "bucketBy", "rules"],
392
+ "additionalProperties": false,
393
+ "description": "JSON Schema for creating Featurevisor feature, expressed in YAML"
313
394
  }