Skip to content

Commit 390b1a4

Browse files
authored
Fix requestBodyRequired (#5465) (#5470)
(cherry picked from commit 62d200f) # Conflicts: # output/openapi/elasticsearch-openapi.json # output/openapi/elasticsearch-serverless-openapi.json # output/schema/schema.json
1 parent 616878c commit 390b1a4

File tree

5 files changed

+289
-177
lines changed

5 files changed

+289
-177
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)