From 70a61b1aaca50f3365ccd2bb650dceb57095759f Mon Sep 17 00:00:00 2001 From: Steven Serrata <9343811+sserrata@users.noreply.github.com> Date: Wed, 22 Jan 2025 09:38:56 -0500 Subject: [PATCH] normalize body array instead of returning literal (#1066) --- .../src/openapi/createRequestExample.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/docusaurus-plugin-openapi-docs/src/openapi/createRequestExample.ts b/packages/docusaurus-plugin-openapi-docs/src/openapi/createRequestExample.ts index 48dc5b7d4..8e0547b0d 100644 --- a/packages/docusaurus-plugin-openapi-docs/src/openapi/createRequestExample.ts +++ b/packages/docusaurus-plugin-openapi-docs/src/openapi/createRequestExample.ts @@ -181,7 +181,7 @@ export const sampleRequestFromSchema = (schema: SchemaObject = {}): any => { return items?.oneOf.map((item: any) => sampleRequestFromSchema(item)); } - return [sampleRequestFromSchema(items)]; + return normalizeArray(sampleRequestFromSchema(items)); } if (schemaCopy.enum) {