From 64dd946f499599118e4b38791fdc69756402386c Mon Sep 17 00:00:00 2001 From: Marc L Date: Thu, 7 Nov 2024 12:43:17 -0600 Subject: [PATCH 1/2] Add support for array of types --- .../src/theme/SchemaItem/index.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/docusaurus-theme-openapi-docs/src/theme/SchemaItem/index.tsx b/packages/docusaurus-theme-openapi-docs/src/theme/SchemaItem/index.tsx index ead487674..48ab32d80 100644 --- a/packages/docusaurus-theme-openapi-docs/src/theme/SchemaItem/index.tsx +++ b/packages/docusaurus-theme-openapi-docs/src/theme/SchemaItem/index.tsx @@ -195,7 +195,9 @@ export default function SchemaItem(props: Props) { > {name} - {schemaName} + + {Array.isArray(schemaName) ? schemaName.join(" | ") : schemaName} + {(nullable || required || deprecated) && ( )} From 1a68f26d9ff754459f4bcd55a7410f1793a218f8 Mon Sep 17 00:00:00 2001 From: Marc L Date: Thu, 7 Nov 2024 12:53:37 -0600 Subject: [PATCH 2/2] Add example for multiple types --- demo/examples/petstore-1.0.0.yaml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/demo/examples/petstore-1.0.0.yaml b/demo/examples/petstore-1.0.0.yaml index 7fde9ea1d..3c5e1c0d2 100644 --- a/demo/examples/petstore-1.0.0.yaml +++ b/demo/examples/petstore-1.0.0.yaml @@ -242,10 +242,14 @@ paths: properties: name: description: Updated name of the pet - type: string + type: + - string + - "null" status: description: Updated status of the pet - type: string + type: + - string + - "null" delete: tags: - pet