From 19e161008fbaed34277e491c51aeb1badb5901c8 Mon Sep 17 00:00:00 2001 From: Andriy Zaleskyy Date: Wed, 6 Oct 2021 11:50:21 +0300 Subject: [PATCH] test: The number of items in the array in the array is incorrect #1762 --- demo/openapi-3-1.yaml | 11 +++++++++++ demo/openapi.yaml | 2 ++ .../DiscriminatorDropdown.test.tsx.snap | 4 ++++ .../loadAndBundleSpec.test.ts.snap | 17 +++++++++++++++++ 4 files changed, 34 insertions(+) diff --git a/demo/openapi-3-1.yaml b/demo/openapi-3-1.yaml index 31063d4b..ace99f7b 100644 --- a/demo/openapi-3-1.yaml +++ b/demo/openapi-3-1.yaml @@ -384,6 +384,17 @@ paths: type: array items: $ref: '#/components/schemas/Pet' + application/xml-dtd: + schema: + type: array + maxItems: 999 + minItems: 0 + items: + type: array + maxItems: 777 + minItems: 111 + items: + type: number '400': description: Invalid tag value security: diff --git a/demo/openapi.yaml b/demo/openapi.yaml index c570cc60..5cf19340 100644 --- a/demo/openapi.yaml +++ b/demo/openapi.yaml @@ -377,7 +377,9 @@ paths: application/xml: schema: type: array + maxItems: 999 items: + maxItems: 111 $ref: '#/components/schemas/Pet' '400': description: Invalid tag value diff --git a/src/components/__tests__/__snapshots__/DiscriminatorDropdown.test.tsx.snap b/src/components/__tests__/__snapshots__/DiscriminatorDropdown.test.tsx.snap index fe5617ed..7af7b482 100644 --- a/src/components/__tests__/__snapshots__/DiscriminatorDropdown.test.tsx.snap +++ b/src/components/__tests__/__snapshots__/DiscriminatorDropdown.test.tsx.snap @@ -33,6 +33,8 @@ exports[`Components SchemaView discriminator should correctly render discriminat "format": undefined, "isCircular": undefined, "isPrimitive": true, + "maxItems": undefined, + "minItems": undefined, "options": "<<>>", "pattern": undefined, "pointer": "#/components/schemas/Dog/properties/packSize", @@ -86,6 +88,8 @@ exports[`Components SchemaView discriminator should correctly render discriminat "format": undefined, "isCircular": undefined, "isPrimitive": true, + "maxItems": undefined, + "minItems": undefined, "options": "<<>>", "pattern": undefined, "pointer": "#/components/schemas/Dog/properties/type", diff --git a/src/utils/__tests__/__snapshots__/loadAndBundleSpec.test.ts.snap b/src/utils/__tests__/__snapshots__/loadAndBundleSpec.test.ts.snap index 7807e39e..4c9a1d11 100644 --- a/src/utils/__tests__/__snapshots__/loadAndBundleSpec.test.ts.snap +++ b/src/utils/__tests__/__snapshots__/loadAndBundleSpec.test.ts.snap @@ -729,7 +729,9 @@ try { "schema": Object { "items": Object { "$ref": "#/components/schemas/Pet", + "maxItems": 111, }, + "maxItems": 999, "type": "array", }, }, @@ -2562,6 +2564,21 @@ try { "type": "array", }, }, + "application/xml-dtd": Object { + "schema": Object { + "items": Object { + "items": Object { + "type": "number", + }, + "maxItems": 777, + "minItems": 111, + "type": "array", + }, + "maxItems": 999, + "minItems": 0, + "type": "array", + }, + }, }, "description": "successful operation", },