From e4a1a4ddafccb37e770bf5daac3d93c9196953fd Mon Sep 17 00:00:00 2001 From: Bryan Date: Thu, 20 Feb 2025 16:08:57 -0800 Subject: [PATCH] Check for body content length --- packages/docusaurus-plugin-openapi-docs/src/openapi/openapi.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/docusaurus-plugin-openapi-docs/src/openapi/openapi.ts b/packages/docusaurus-plugin-openapi-docs/src/openapi/openapi.ts index fabb417da..64d7f23e1 100644 --- a/packages/docusaurus-plugin-openapi-docs/src/openapi/openapi.ts +++ b/packages/docusaurus-plugin-openapi-docs/src/openapi/openapi.ts @@ -191,7 +191,8 @@ function createItems( // Handle vendor JSON media types const bodyContent = operationObject.requestBody?.content; - if (bodyContent) { + + if (bodyContent && Object.keys(bodyContent).length > 0) { const firstBodyContentKey = Object.keys(bodyContent)[0]; if (firstBodyContentKey.endsWith("+json")) { const firstBody = bodyContent[firstBodyContentKey];