Skip to content

Commit

Permalink
馃悰 fix: ensure request body properties are defined (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
luquitared committed Jun 30, 2024
1 parent b90f1d9 commit 933b53c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/openapi/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
Expand Down

0 comments on commit 933b53c

Please sign in to comment.