-
Notifications
You must be signed in to change notification settings - Fork 229
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SDK-417 generate json for experimenter from ir (#4656)
* [WIP] generate json for experimenter from ir * adds tests for schema generation * removes default featurs from jsonschema * Adjust schema to accept key-value features * Changes enum to string with enum variants * cargo fmt * fixes cli.yaml for experimenter
- Loading branch information
Tarik Eshaq
authored
Nov 26, 2021
1 parent
214cb80
commit d53cfa8
Showing
7 changed files
with
486 additions
and
13 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,3 +19,4 @@ heck = "0.3.3" | |
|
||
[dev-dependencies] | ||
tempdir = "0.3.7" | ||
jsonschema = { version = "0.13", default-features = false } |
82 changes: 82 additions & 0 deletions
82
components/support/nimbus-fml/ExperimentFeatureManifest.schema.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"$ref": "#/definitions/Features", | ||
"definitions": { | ||
"Features": { | ||
"patternProperties": { | ||
"[a-zA-Z0-9_]+": { | ||
"additionalProperties": false, | ||
"type": "object", | ||
"properties": { | ||
"description": { | ||
"type": "string" | ||
}, | ||
"hasExposure": { | ||
"type": "boolean", | ||
"description": "If the feature sends an exposure event." | ||
}, | ||
"exposureDescription": { | ||
"type": "string", | ||
"description": "A description of the implementation details of the exposure event, if one is sent." | ||
}, | ||
"isEarlyStartup": { | ||
"type": "boolean", | ||
"description": "If the feature values should be cached in prefs for fast early startup." | ||
}, | ||
"variables": { | ||
"additionalProperties": false, | ||
"type": "object", | ||
"patternProperties": { | ||
"[a-zA-Z0-9_]+": { | ||
"type": "object", | ||
"properties": { | ||
"type": { | ||
"type": "string", | ||
"enum": [ | ||
"json", | ||
"boolean", | ||
"int", | ||
"string" | ||
] | ||
}, | ||
"fallbackPref": { | ||
"type": "string" | ||
}, | ||
"enum": { | ||
"description": "Validate feature value using a list of possible options (for string only values)." | ||
}, | ||
"description": { | ||
"type": "string", | ||
"description": "Explain how this value is being used" | ||
} | ||
}, | ||
"required": [ | ||
"type", | ||
"description" | ||
], | ||
"additionalProperties": false | ||
} | ||
} | ||
} | ||
}, | ||
"required": [ | ||
"description", | ||
"hasExposure" | ||
], | ||
"if": { | ||
"properties": { | ||
"hasExposure": { | ||
"const": true | ||
} | ||
} | ||
}, | ||
"then": { | ||
"required": [ | ||
"exposureDescription" | ||
] | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.