Skip to content

Commit

Permalink
Fix validation of chain_choices and replacements
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sevein committed Sep 28, 2023
1 parent f7f1218 commit 8d57251
Showing 1 changed file with 25 additions and 29 deletions.
54 changes: 25 additions & 29 deletions src/MCPServer/lib/assets/workflow-schema-v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,9 @@
"type": "string"
},
"chain_choices": {
"items": [
{
"$ref": "#/definitions/uuid"
}
],
"items": {
"$ref": "#/definitions/uuid"
},
"minItems": 1,
"type": "array"
}
Expand Down Expand Up @@ -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"
}
Expand Down

0 comments on commit 8d57251

Please sign in to comment.