Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions compiler/src/model/build-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@ function compileClassOrInterfaceDeclaration (declaration: ClassDeclaration | Int

// validate body
if (bodyMember != null) {
mapping.requestBodyRequired = !(bodyMember as PropertySignature).hasQuestionToken()
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We check if the body has a question token, that is, if it is written as body?: ....

This was already applied in the case of bodyValue below (line 319/320), but this branch was missed, which means the default from rest-api-spec, "required: false," was taking over.

assert(
bodyMember,
methods.some(method => ['POST', 'PUT', 'DELETE'].includes(method)),
Expand Down
Loading
Loading