From 070adda00ddf3edd97dd14fcff60ba0795136833 Mon Sep 17 00:00:00 2001 From: Florin-Mihai Anghel <44744433+anghelflorinm@users.noreply.github.com> Date: Tue, 27 Aug 2024 16:07:46 +0200 Subject: [PATCH] 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 https://github.com/open-feature/codegen/issues/1 ### Notes Is based on https://docs.google.com/document/d/19GQpSNcLnDEbzJRL6FpzKHFEQWVGNrgNK25lC4-JuE8/edit#heading=h.f1glu5dk43k9 --------- Signed-off-by: Florin-Mihai Anghel --- docs/schema/v0/flag_manifest.json | 122 ++++++++++++++++++++++++++++++ 1 file changed, 122 insertions(+) create mode 100644 docs/schema/v0/flag_manifest.json diff --git a/docs/schema/v0/flag_manifest.json b/docs/schema/v0/flag_manifest.json new file mode 100644 index 0000000..02699a1 --- /dev/null +++ b/docs/schema/v0/flag_manifest.json @@ -0,0 +1,122 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Flag Manifest", + "description": "Describes a configuration of OpenFeature flags, including info such as their types and default values.", + "type": "object", + "properties": { + "flags": { + "description": "Object containing the flags in the config", + "type": "object", + "patternProperties": { + "^.{1,}$": { + "description": "The definition of one flag", + "$ref": "#/$defs/flag" + } + }, + "additionalProperties": false + } + }, + "required": ["flags"], + "$defs": { + "flag": { + "oneOf": [ + { + "$ref": "#/$defs/booleanType" + }, + { + "$ref": "#/$defs/stringType" + }, + { + "$ref": "#/$defs/integerType" + }, + { + "$ref": "#/$defs/numberType" + }, + { + "$ref": "#/$defs/objectType" + } + ], + "required": ["flag_type", "default_value"] + }, + "booleanType": { + "type": "object", + "properties": { + "flag_type": { + "type": "string", + "enum": ["boolean"] + }, + "default_value": { + "type": "boolean" + }, + "description": { + "type": "string" + } + }, + "additionalProperties": false + }, + "stringType": { + "type": "object", + "properties": { + "flag_type": { + "type": "string", + "enum": ["string"] + }, + "default_value": { + "type": "string" + }, + "description": { + "type": "string" + } + }, + "additionalProperties": false + }, + "integerType": { + "type": "object", + "properties": { + "flag_type": { + "type": "string", + "enum": ["integer"] + }, + "default_value": { + "type": "integer" + }, + "description": { + "type": "string" + } + }, + "additionalProperties": false + }, + "numberType": { + "type": "object", + "properties": { + "flag_type": { + "type": "string", + "enum": ["number"] + }, + "default_value": { + "type": "number" + }, + "description": { + "type": "string" + } + }, + "additionalProperties": false + }, + "objectType": { + "type": "object", + "properties": { + "flag_type": { + "type": "string", + "enum": ["object"] + }, + "default_value": { + "type": "object" + }, + "description": { + "type": "string" + } + }, + "additionalProperties": false + } + } +} \ No newline at end of file