From 933b53cf75176b6b277a5e0145a1ca7075057083 Mon Sep 17 00:00:00 2001 From: Lucas Negritto <33329230+luquitared@users.noreply.github.com> Date: Sat, 29 Jun 2024 20:40:53 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix:=20ensure=20request=20body?= =?UTF-8?q?=20properties=20are=20defined=20(#43)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/openapi/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openapi/index.ts b/src/openapi/index.ts index 75486d3..a1faf70 100644 --- a/src/openapi/index.ts +++ b/src/openapi/index.ts @@ -30,7 +30,7 @@ export class OpenAPIConvertor { const parameters = this.mergeSchemas(...Object.values(parametersSchema)); - if (requestBodySchema && Object.keys(requestBodySchema.properties).length > 0) { + if (requestBodySchema && requestBodySchema.properties && Object.keys(requestBodySchema.properties).length > 0) { parameters.properties[OPENAPI_REQUEST_BODY_KEY] = requestBodySchema; parameters.required?.push('_requestBody'); }