From 0df0dfb80d0533d2b4137f1c874445dc3bdd8f36 Mon Sep 17 00:00:00 2001 From: "lukasz.zazulak" Date: Wed, 28 Jan 2026 12:49:19 +0100 Subject: [PATCH 1/3] fix(utils): disallow schema type array value string --- src/core/utils/index.js | 3 +-- test/unit/core/utils.js | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/core/utils/index.js b/src/core/utils/index.js index 9b008587f84..9e9934d9066 100644 --- a/src/core/utils/index.js +++ b/src/core/utils/index.js @@ -466,7 +466,6 @@ function validateValueBySchema(value, schema, requiredByParam, bypassRequiredChe let stringCheck = type === "string" && value let arrayCheck = type === "array" && Array.isArray(value) && value.length let arrayListCheck = type === "array" && Im.List.isList(value) && value.count() - let arrayStringCheck = type === "array" && typeof value === "string" && value let fileCheck = type === "file" && value instanceof win.File let booleanCheck = type === "boolean" && (value || value === false) let numberCheck = type === "number" && (value || value === 0) @@ -475,7 +474,7 @@ function validateValueBySchema(value, schema, requiredByParam, bypassRequiredChe let objectStringCheck = type === "object" && typeof value === "string" && value const allChecks = [ - stringCheck, arrayCheck, arrayListCheck, arrayStringCheck, fileCheck, + stringCheck, arrayCheck, arrayListCheck, fileCheck, booleanCheck, numberCheck, integerCheck, objectCheck, objectStringCheck, ] diff --git a/test/unit/core/utils.js b/test/unit/core/utils.js index 5787fd7de88..b69a03edd5d 100644 --- a/test/unit/core/utils.js +++ b/test/unit/core/utils.js @@ -749,7 +749,7 @@ describe("utils", () => { type: "array" } value = "[1]" - assertValidateParam(param, value, []) + assertValidateParam(param, value, ["Required field is not provided"]) // valid array, items match type param = { From c40390e8e82449ed361c8d790d5397c3b78a044a Mon Sep 17 00:00:00 2001 From: "lukasz.zazulak" Date: Thu, 29 Jan 2026 19:09:01 +0100 Subject: [PATCH 2/3] fix(utils): disallow schema type array value string --- ...chema-type-array-example-type-string.cy.js | 12 ++++++++++ ...schema-type-array-example-type-string.yaml | 23 +++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 test/e2e-cypress/e2e/features/try-it-out-schema-type-array-example-type-string.cy.js create mode 100644 test/e2e-cypress/static/documents/features/try-it-out-schema-type-array-example-type-string.yaml diff --git a/test/e2e-cypress/e2e/features/try-it-out-schema-type-array-example-type-string.cy.js b/test/e2e-cypress/e2e/features/try-it-out-schema-type-array-example-type-string.cy.js new file mode 100644 index 00000000000..43b435042c2 --- /dev/null +++ b/test/e2e-cypress/e2e/features/try-it-out-schema-type-array-example-type-string.cy.js @@ -0,0 +1,12 @@ +describe.only("Try it out with schema type array but example type string", () => { + it("shows a validation error message when Execute is clicked", () => { + cy + .visit("?tryItOutEnabled=true&url=/documents/features/try-it-out-schema-type-array-example-type-string.yaml") + .get("#operations-default-get_") + .click() + .get(".btn.execute") + .click() + .get(".validation-errors") + .should("exist") + }) + }) diff --git a/test/e2e-cypress/static/documents/features/try-it-out-schema-type-array-example-type-string.yaml b/test/e2e-cypress/static/documents/features/try-it-out-schema-type-array-example-type-string.yaml new file mode 100644 index 00000000000..118afd1e871 --- /dev/null +++ b/test/e2e-cypress/static/documents/features/try-it-out-schema-type-array-example-type-string.yaml @@ -0,0 +1,23 @@ +openapi: 3.0.3 +info: + title: test + version: 1.0.0 +paths: + /: + get: + parameters: + - in: query + name: test + required: true + schema: + type: array + example: 'test1' + items: + type: string + enum: + - 'test1' + - 'test2' + - 'test3' + responses: + default: + description: ok From 4c293c140314babd053c31c82bf3d46b7f99c0f7 Mon Sep 17 00:00:00 2001 From: "lukasz.zazulak" Date: Fri, 30 Jan 2026 09:36:32 +0100 Subject: [PATCH 3/3] fix(utils): disallow schema type array value string --- .../try-it-out-schema-type-array-example-type-string.cy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e-cypress/e2e/features/try-it-out-schema-type-array-example-type-string.cy.js b/test/e2e-cypress/e2e/features/try-it-out-schema-type-array-example-type-string.cy.js index 43b435042c2..cf25a9c030c 100644 --- a/test/e2e-cypress/e2e/features/try-it-out-schema-type-array-example-type-string.cy.js +++ b/test/e2e-cypress/e2e/features/try-it-out-schema-type-array-example-type-string.cy.js @@ -1,4 +1,4 @@ -describe.only("Try it out with schema type array but example type string", () => { +describe("Try it out with schema type array but example type string", () => { it("shows a validation error message when Execute is clicked", () => { cy .visit("?tryItOutEnabled=true&url=/documents/features/try-it-out-schema-type-array-example-type-string.yaml")