From 86066ee61b3458fa684e897017ef8988859d752a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Garc=C3=ADa=20Crespo?= Date: Thu, 28 Sep 2023 09:05:20 +0000 Subject: [PATCH] Fix validation of chain_choices and replacements Only the first item in the `chain_choices` and `replacements` arrays was being validated due to our usage of an array of schemas, leading to tuple validation. In this context, each position in the array was expected to validate against the schema at the corresponding position in the `items` array, leaving subsequent items unvalidated. This commit addresses this by converting `items` into a single schema object, ensuring that validation applies to all items within the array, not just the first. --- .../lib/assets/workflow-schema-v1.json | 54 +++++++++---------- 1 file changed, 25 insertions(+), 29 deletions(-) diff --git a/src/MCPServer/lib/assets/workflow-schema-v1.json b/src/MCPServer/lib/assets/workflow-schema-v1.json index 20c60b55f6..62a44cdbd9 100644 --- a/src/MCPServer/lib/assets/workflow-schema-v1.json +++ b/src/MCPServer/lib/assets/workflow-schema-v1.json @@ -112,11 +112,9 @@ "type": "string" }, "chain_choices": { - "items": [ - { - "$ref": "#/definitions/uuid" - } - ], + "items": { + "$ref": "#/definitions/uuid" + }, "minItems": 1, "type": "array" } @@ -212,31 +210,29 @@ "type": "string" }, "replacements": { - "items": [ - { - "additionalProperties": false, - "properties": { - "description": { - "$ref": "#/definitions/translations" - }, - "id": { - "$ref": "#/definitions/uuid" - }, - "items": { - "additionalProperties": { - "type": "string" - }, - "type": "object" - } + "items": { + "additionalProperties": false, + "properties": { + "description": { + "$ref": "#/definitions/translations" }, - "required": [ - "id", - "description", - "items" - ], - "type": "object" - } - ], + "id": { + "$ref": "#/definitions/uuid" + }, + "items": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + } + }, + "required": [ + "id", + "description", + "items" + ], + "type": "object" + }, "minItems": 0, "type": "array" }