From 642e043f7df1dd8ee80a5eb29295730b078d033d Mon Sep 17 00:00:00 2001 From: Gnought <1684105+gnought@users.noreply.github.com> Date: Tue, 2 Sep 2025 20:54:03 +0800 Subject: [PATCH 1/2] Update aws-cdk-appconfig-featureflags-1.0.0.json The updated schema is based on the official AWS doc: https://docs.aws.amazon.com/appconfig/latest/userguide/appconfig-type-reference-feature-flags.html --- .../aws-cdk-appconfig-featureflags-1.0.0.json | 147 ++++++++---------- 1 file changed, 69 insertions(+), 78 deletions(-) diff --git a/src/schemas/json/aws-cdk-appconfig-featureflags-1.0.0.json b/src/schemas/json/aws-cdk-appconfig-featureflags-1.0.0.json index 671b7f4eb3b..7a535f1403c 100644 --- a/src/schemas/json/aws-cdk-appconfig-featureflags-1.0.0.json +++ b/src/schemas/json/aws-cdk-appconfig-featureflags-1.0.0.json @@ -1,11 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", "$id": "https://json.schemastore.org/aws-cdk-appconfig-featureflags-1.0.0.json", - "allOf": [ - { - "$ref": "#/definitions/flagSetDefinition" - } - ], "definitions": { "flagSetDefinition": { "type": "object", @@ -20,17 +15,16 @@ "$ref": "#/definitions/flagValues" } }, - "required": ["version", "flags", "values"], + "required": ["version"], "additionalProperties": false }, "flagDefinitions": { "type": "object", "patternProperties": { - "^[^\\n]{1,64}$": { + "^[a-z][a-zA-Z\\d_-]{0,63}$": { "$ref": "#/definitions/flagDefinition" } }, - "maxProperties": 25, "additionalProperties": false }, "flagDefinition": { @@ -52,26 +46,26 @@ "type": "object", "properties": { "status": { - "const": "planned" + "type": "string", + "enum": ["planned"] }, "date": { "type": "string", "format": "date" } }, - "additionalProperties": false + "additionalProperties": false }, "attributes": { "$ref": "#/definitions/attributeDefinitions" } }, - "required": ["attributes"], "additionalProperties": false }, "attributeDefinitions": { "type": "object", "patternProperties": { - "^[^\\n]{1,64}$": { + "^[a-z][a-zA-Z\\d_-]{0,63}$": { "$ref": "#/definitions/attributeDefinition" } }, @@ -86,32 +80,22 @@ }, "constraints": { "oneOf": [ - { - "$ref": "#/definitions/numberConstraints" - }, - { - "$ref": "#/definitions/stringConstraints" - }, - { - "$ref": "#/definitions/arrayConstraints" - }, - { - "$ref": "#/definitions/boolConstraints" - } + { "$ref": "#/definitions/numberConstraints" }, + { "$ref": "#/definitions/stringConstraints" }, + { "$ref": "#/definitions/arrayConstraints" }, + { "$ref": "#/definitions/boolConstraints" } ] } }, - "required": ["constraints"], "additionalProperties": false }, "flagValues": { "type": "object", "patternProperties": { - "^[^\\n]{1,64}$": { + "^[a-z][a-zA-Z\\d_-]{0,63}$": { "$ref": "#/definitions/flagValue" } }, - "maxProperties": 25, "additionalProperties": false }, "flagValue": { @@ -128,21 +112,50 @@ }, "_variants": { "type": "array", - "uniqueItems": true, - "maxItems": 32, + "maxLength": 32, "items": { "$ref": "#/definitions/variant" } } }, - "required": ["enabled", "_variants"], + "patternProperties": { + "^[a-z][a-zA-Z\\d_-]{0,63}$": { + "$ref": "#/definitions/attributeValue", + "maxProperties": 25 + } + }, + "additionalProperties": false + }, + "attributeValue": { + "oneOf": [ + { "type": "string", "maxLength": 1024 }, + { "type": "number" }, + { "type": "boolean" }, + { + "type": "array", + "oneOf": [ + { + "items": { + "type": "string", + "maxLength": 1024 + } + }, + { + "items": { + "type": "number" + } + } + ] + } + ], "additionalProperties": false }, "stringConstraints": { "type": "object", "properties": { "type": { - "const": "string" + "type": "string", + "enum": ["string"] }, "required": { "type": "boolean" @@ -153,7 +166,7 @@ }, "enum": { "type": "array", - "maxItems": 100, + "maxLength": 100, "items": { "oneOf": [ { @@ -169,11 +182,7 @@ }, "required": ["type"], "not": { - "required": ["pattern", "enum"], - "properties": { - "pattern": true, - "enum": true - } + "required": ["pattern", "enum"] }, "additionalProperties": false }, @@ -181,7 +190,8 @@ "type": "object", "properties": { "type": { - "const": "number" + "type": "string", + "enum": ["number"] }, "required": { "type": "boolean" @@ -200,7 +210,8 @@ "type": "object", "properties": { "type": { - "const": "array" + "type": "string", + "enum": ["array"] }, "required": { "type": "boolean" @@ -216,7 +227,8 @@ "type": "object", "properties": { "type": { - "const": "boolean" + "type": "string", + "enum": ["boolean"] }, "required": { "type": "boolean" @@ -227,12 +239,8 @@ }, "elementConstraints": { "oneOf": [ - { - "$ref": "#/definitions/numberConstraints" - }, - { - "$ref": "#/definitions/stringConstraints" - } + { "$ref": "#/definitions/numberConstraints" }, + { "$ref": "#/definitions/stringConstraints" } ] }, "variant": { @@ -246,43 +254,22 @@ }, "rule": { "type": "string", - "maxLength": 1024 + "maxLength": 16384 }, "attributeValues": { - "$ref": "#/definitions/attributeValue" + "type": "object", + "patternProperties": { + "^[a-z][a-zA-Z\\d_-]{0,63}$": { + "$ref": "#/definitions/attributeValue" + } + }, + "maxProperties": 25, + "additionalProperties": false } }, "required": ["name", "enabled"], "additionalProperties": false }, - "attributeValue": { - "oneOf": [ - { - "type": "string", - "maxLength": 1024 - }, - { - "type": "number" - }, - { - "type": "boolean" - }, - { - "type": "array", - "items": { - "oneOf": [ - { - "type": "string", - "maxLength": 1024 - }, - { - "type": "number" - } - ] - } - } - ] - }, "customerDefinedName": { "type": "string", "pattern": "^[^\\n]{1,64}$" @@ -292,7 +279,11 @@ "maxLength": 1024 }, "flagSchemaVersions": { - "const": "1" + "type": "string", + "enum": ["1"] } - } + }, + "type": "object", + "$ref": "#/definitions/flagSetDefinition", + "additionalProperties": false } From 9cc82df5d28483b7737697579332f9759bdcae55 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 2 Sep 2025 12:56:26 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/schemas/json/aws-cdk-appconfig-featureflags-1.0.0.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/schemas/json/aws-cdk-appconfig-featureflags-1.0.0.json b/src/schemas/json/aws-cdk-appconfig-featureflags-1.0.0.json index 7a535f1403c..0fc0412c4d9 100644 --- a/src/schemas/json/aws-cdk-appconfig-featureflags-1.0.0.json +++ b/src/schemas/json/aws-cdk-appconfig-featureflags-1.0.0.json @@ -1,6 +1,7 @@ { "$schema": "http://json-schema.org/draft-07/schema#", "$id": "https://json.schemastore.org/aws-cdk-appconfig-featureflags-1.0.0.json", + "$ref": "#/definitions/flagSetDefinition", "definitions": { "flagSetDefinition": { "type": "object", @@ -54,7 +55,7 @@ "format": "date" } }, - "additionalProperties": false + "additionalProperties": false }, "attributes": { "$ref": "#/definitions/attributeDefinitions" @@ -257,7 +258,7 @@ "maxLength": 16384 }, "attributeValues": { - "type": "object", + "type": "object", "patternProperties": { "^[a-z][a-zA-Z\\d_-]{0,63}$": { "$ref": "#/definitions/attributeValue" @@ -284,6 +285,5 @@ } }, "type": "object", - "$ref": "#/definitions/flagSetDefinition", "additionalProperties": false }