From 5e27116e1790a85461fede2a193368f7a6f0d3de Mon Sep 17 00:00:00 2001 From: Jaroslav Hejlek Date: Wed, 21 Jun 2023 09:56:08 +0200 Subject: [PATCH 1/2] fix: correct order of input definitions --- packages/input_schema/src/schema.json | 52 +++++++++++++-------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/packages/input_schema/src/schema.json b/packages/input_schema/src/schema.json index cc9d550c5..2313a5d95 100644 --- a/packages/input_schema/src/schema.json +++ b/packages/input_schema/src/schema.json @@ -134,32 +134,6 @@ } } }, - "arrayProperty": { - "title": "Array property", - "type": "object", - "additionalProperties": false, - "properties": { - "type": { "enum": ["array"] }, - "title": { "type": "string" }, - "description": { "type": "string" }, - "default": { "type": "array" }, - "prefill": { "type": "array" }, - "example": { "type": "array" }, - "placeholderKey": { "type": "string" }, - "placeholderValue": { "type": "string" }, - "patternKey": { "type": "string" }, - "patternValue": { "type": "string" }, - "nullable": { "type": "boolean" }, - "minItems": { "type": "integer" }, - "maxItems": { "type": "integer" }, - "uniqueItems": { "type": "boolean" }, - - "editor": { "enum": ["json", "requestListSources", "pseudoUrls", "globs", "keyValue", "stringList", "hidden"] }, - "sectionCaption": { "type": "string" }, - "sectionDescription": { "type": "string" } - }, - "required": ["type", "title", "description", "editor"] - }, "arrayEnumProperty": { "title": "Array enum property", @@ -199,6 +173,32 @@ }, "required": ["type", "editor", "title", "description", "items"] }, + "arrayProperty": { + "title": "Array property", + "type": "object", + "additionalProperties": false, + "properties": { + "type": { "enum": ["array"] }, + "editor": { "enum": ["json", "requestListSources", "pseudoUrls", "globs", "keyValue", "stringList", "hidden"] }, + "title": { "type": "string" }, + "description": { "type": "string" }, + "default": { "type": "array" }, + "prefill": { "type": "array" }, + "example": { "type": "array" }, + "placeholderKey": { "type": "string" }, + "placeholderValue": { "type": "string" }, + "patternKey": { "type": "string" }, + "patternValue": { "type": "string" }, + "nullable": { "type": "boolean" }, + "minItems": { "type": "integer" }, + "maxItems": { "type": "integer" }, + "uniqueItems": { "type": "boolean" }, + + "sectionCaption": { "type": "string" }, + "sectionDescription": { "type": "string" } + }, + "required": ["type", "title", "description", "editor"] + }, "objectProperty": { "title": "Object property", "type": "object", From f523e03b0c8baa76128eadba1439588ef987b59a Mon Sep 17 00:00:00 2001 From: Jaroslav Hejlek Date: Wed, 21 Jun 2023 10:19:47 +0200 Subject: [PATCH 2/2] fix: better fix to the array enum issue --- packages/input_schema/src/schema.json | 85 ++++++++++++--------------- 1 file changed, 38 insertions(+), 47 deletions(-) diff --git a/packages/input_schema/src/schema.json b/packages/input_schema/src/schema.json index 2313a5d95..09d874369 100644 --- a/packages/input_schema/src/schema.json +++ b/packages/input_schema/src/schema.json @@ -36,7 +36,6 @@ { "$ref": "#/definitions/stringProperty" }, { "$ref": "#/definitions/stringEnumProperty" }, { "$ref": "#/definitions/arrayProperty" }, - { "$ref": "#/definitions/arrayEnumProperty"}, { "$ref": "#/definitions/objectProperty" }, { "$ref": "#/definitions/integerProperty" }, { "$ref": "#/definitions/booleanProperty" }, @@ -134,61 +133,17 @@ } } }, - - "arrayEnumProperty": { - "title": "Array enum property", - "type": "object", - "additionalProperties": false, - "properties": { - "type": { "enum": ["array"] }, - "editor": { "enum": ["select"] }, - "title": { "type": "string" }, - "description": { "type": "string" }, - "default": { "type": "array" }, - "prefill": { "type": "array" }, - "example": { "type": "array" }, - "minItems": { "type": "integer" }, - "maxItems": { "type": "integer" }, - "uniqueItems": { "type": "boolean" }, - "nullable": { "type": "boolean" }, - "sectionCaption": { "type": "string" }, - "sectionDescription": { "type": "string" }, - "items": { - "type": "object", - "additionalProperties": false, - "properties": { - "type": { "enum": ["string"] }, - "enum": { - "type": "array", - "items": { "type": "string" }, - "uniqueItems": true - }, - "enumTitles": { - "type": "array", - "items": { "type": "string" } - } - }, - "required": ["type", "enum"] - } - }, - "required": ["type", "editor", "title", "description", "items"] - }, "arrayProperty": { "title": "Array property", "type": "object", - "additionalProperties": false, "properties": { "type": { "enum": ["array"] }, - "editor": { "enum": ["json", "requestListSources", "pseudoUrls", "globs", "keyValue", "stringList", "hidden"] }, + "editor": { "enum": ["json", "requestListSources", "pseudoUrls", "globs", "keyValue", "stringList", "select", "hidden"] }, "title": { "type": "string" }, "description": { "type": "string" }, "default": { "type": "array" }, "prefill": { "type": "array" }, "example": { "type": "array" }, - "placeholderKey": { "type": "string" }, - "placeholderValue": { "type": "string" }, - "patternKey": { "type": "string" }, - "patternValue": { "type": "string" }, "nullable": { "type": "boolean" }, "minItems": { "type": "integer" }, "maxItems": { "type": "integer" }, @@ -197,7 +152,43 @@ "sectionCaption": { "type": "string" }, "sectionDescription": { "type": "string" } }, - "required": ["type", "title", "description", "editor"] + "additionalProperties": true, + "required": ["type", "title", "description", "editor"], + "if": { + "properties": { + "editor": { "const": "select" } + } + }, + "then": { + "required": ["items"], + "properties": { + "items": { + "type": "object", + "additionalProperties": false, + "properties": { + "type": { "enum": ["string"] }, + "enum": { + "type": "array", + "items": { "type": "string" }, + "uniqueItems": true + }, + "enumTitles": { + "type": "array", + "items": { "type": "string" } + } + }, + "required": ["type", "enum"] + } + } + }, + "else": { + "properties": { + "placeholderKey": { "type": "string" }, + "placeholderValue": { "type": "string" }, + "patternKey": { "type": "string" }, + "patternValue": { "type": "string" } + } + } }, "objectProperty": { "title": "Object property",