From 518fee1a8c96e9398072f4cff932f513c1520e9b Mon Sep 17 00:00:00 2001 From: Thomas Heartman Date: Mon, 12 Sep 2022 15:51:52 +0200 Subject: [PATCH] Fix validate-edge-tokens OpenAPI schema (#2055) * fix: varidate-edge-tokens-schema tokens type This change fixes the description of the 'tokens' array of the validate edge tokens schema. The source of the error was a simple inverson of anyOf and items. * fix: update snapshot --- .../openapi/spec/validate-edge-tokens-schema.ts | 10 ++++++---- .../openapi/__snapshots__/openapi.e2e.test.ts.snap | 14 ++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/lib/openapi/spec/validate-edge-tokens-schema.ts b/src/lib/openapi/spec/validate-edge-tokens-schema.ts index 8c77d0a270..33691f40fb 100644 --- a/src/lib/openapi/spec/validate-edge-tokens-schema.ts +++ b/src/lib/openapi/spec/validate-edge-tokens-schema.ts @@ -9,10 +9,12 @@ export const validateEdgeTokensSchema = { properties: { tokens: { type: 'array', - anyOf: [ - { items: { $ref: '#/components/schemas/edgeTokenSchema' } }, - { items: { type: 'string' } }, - ], + items: { + anyOf: [ + { $ref: '#/components/schemas/edgeTokenSchema' }, + { type: 'string' }, + ], + }, }, }, components: { diff --git a/src/test/e2e/api/openapi/__snapshots__/openapi.e2e.test.ts.snap b/src/test/e2e/api/openapi/__snapshots__/openapi.e2e.test.ts.snap index e574882aec..ed1dacfc77 100644 --- a/src/test/e2e/api/openapi/__snapshots__/openapi.e2e.test.ts.snap +++ b/src/test/e2e/api/openapi/__snapshots__/openapi.e2e.test.ts.snap @@ -3169,18 +3169,16 @@ exports[`should serve the OpenAPI spec 1`] = ` "additionalProperties": false, "properties": { "tokens": { - "anyOf": [ - { - "items": { + "items": { + "anyOf": [ + { "$ref": "#/components/schemas/edgeTokenSchema", }, - }, - { - "items": { + { "type": "string", }, - }, - ], + ], + }, "type": "array", }, },