From 00e4c2b6b96b2a91ffb9a377d03f198637adb8ed 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 25415dbedc..2fb948b9ee 100644 --- a/src/MCPServer/lib/assets/workflow-schema-v1.json +++ b/src/MCPServer/lib/assets/workflow-schema-v1.json @@ -138,11 +138,9 @@ "type": "string" }, "chain_choices": { - "items": [ - { - "$ref": "#/definitions/uuid" - } - ], + "items": { + "$ref": "#/definitions/uuid" + }, "minItems": 1, "type": "array" } @@ -327,31 +325,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" }