Skip to content

Commit fac35ca

Browse files
docs: Add initial flag manifest schema (#9)
## This PR Defines a new format for a flag manifest input to the codegen tool, as defined in a JSON schema ### Related Issues Fixes #1 ### Notes Is based on https://docs.google.com/document/d/19GQpSNcLnDEbzJRL6FpzKHFEQWVGNrgNK25lC4-JuE8/edit#heading=h.f1glu5dk43k9 --------- Signed-off-by: Florin-Mihai Anghel <[email protected]> Co-authored-by: Michael Beemer <[email protected]>
1 parent 9101199 commit fac35ca

File tree

1 file changed

+122
-0
lines changed

1 file changed

+122
-0
lines changed

docs/schema/v0/flag_manifest.json

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"title": "Flag Manifest",
4+
"description": "Describes a configuration of OpenFeature flags, including info such as their types and default values.",
5+
"type": "object",
6+
"properties": {
7+
"flags": {
8+
"description": "Object containing the flags in the config",
9+
"type": "object",
10+
"patternProperties": {
11+
"^.{1,}$": {
12+
"description": "The definition of one flag",
13+
"$ref": "#/$defs/flag"
14+
}
15+
},
16+
"additionalProperties": false
17+
}
18+
},
19+
"required": ["flags"],
20+
"$defs": {
21+
"flag": {
22+
"oneOf": [
23+
{
24+
"$ref": "#/$defs/booleanType"
25+
},
26+
{
27+
"$ref": "#/$defs/stringType"
28+
},
29+
{
30+
"$ref": "#/$defs/integerType"
31+
},
32+
{
33+
"$ref": "#/$defs/numberType"
34+
},
35+
{
36+
"$ref": "#/$defs/objectType"
37+
}
38+
],
39+
"required": ["flag_type", "default_value"]
40+
},
41+
"booleanType": {
42+
"type": "object",
43+
"properties": {
44+
"flag_type": {
45+
"type": "string",
46+
"enum": ["boolean"]
47+
},
48+
"default_value": {
49+
"type": "boolean"
50+
},
51+
"description": {
52+
"type": "string"
53+
}
54+
},
55+
"additionalProperties": false
56+
},
57+
"stringType": {
58+
"type": "object",
59+
"properties": {
60+
"flag_type": {
61+
"type": "string",
62+
"enum": ["string"]
63+
},
64+
"default_value": {
65+
"type": "string"
66+
},
67+
"description": {
68+
"type": "string"
69+
}
70+
},
71+
"additionalProperties": false
72+
},
73+
"integerType": {
74+
"type": "object",
75+
"properties": {
76+
"flag_type": {
77+
"type": "string",
78+
"enum": ["integer"]
79+
},
80+
"default_value": {
81+
"type": "integer"
82+
},
83+
"description": {
84+
"type": "string"
85+
}
86+
},
87+
"additionalProperties": false
88+
},
89+
"numberType": {
90+
"type": "object",
91+
"properties": {
92+
"flag_type": {
93+
"type": "string",
94+
"enum": ["number"]
95+
},
96+
"default_value": {
97+
"type": "number"
98+
},
99+
"description": {
100+
"type": "string"
101+
}
102+
},
103+
"additionalProperties": false
104+
},
105+
"objectType": {
106+
"type": "object",
107+
"properties": {
108+
"flag_type": {
109+
"type": "string",
110+
"enum": ["object"]
111+
},
112+
"default_value": {
113+
"type": "object"
114+
},
115+
"description": {
116+
"type": "string"
117+
}
118+
},
119+
"additionalProperties": false
120+
}
121+
}
122+
}

0 commit comments

Comments
 (0)