Skip to content

Commit 1afefdf

Browse files
Fix requestBodyRequired (#5465) (#5466)
(cherry picked from commit 62d200f) Co-authored-by: Quentin Pradet <quentin.pradet@elastic.co>
1 parent 3b3aae2 commit 1afefdf

File tree

4 files changed

+303
-185
lines changed

4 files changed

+303
-185
lines changed

compiler/src/model/build-model.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,7 @@ function compileClassOrInterfaceDeclaration (declaration: ClassDeclaration | Int
286286

287287
// validate body
288288
if (bodyMember != null) {
289+
mapping.requestBodyRequired = !(bodyMember as PropertySignature).hasQuestionToken()
289290
assert(
290291
bodyMember,
291292
methods.some(method => ['POST', 'PUT', 'DELETE'].includes(method)),

0 commit comments

Comments
 (0)