Skip to content

Commit 500ca3d

Browse files
authored
Check for body content length (#1091)
1 parent 2500d35 commit 500ca3d

File tree

1 file changed

+2
-1
lines changed
  • packages/docusaurus-plugin-openapi-docs/src/openapi

1 file changed

+2
-1
lines changed

packages/docusaurus-plugin-openapi-docs/src/openapi/openapi.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,8 @@ function createItems(
191191

192192
// Handle vendor JSON media types
193193
const bodyContent = operationObject.requestBody?.content;
194-
if (bodyContent) {
194+
195+
if (bodyContent && Object.keys(bodyContent).length > 0) {
195196
const firstBodyContentKey = Object.keys(bodyContent)[0];
196197
if (firstBodyContentKey.endsWith("+json")) {
197198
const firstBody = bodyContent[firstBodyContentKey];

0 commit comments

Comments
 (0)