You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Optional] Sponsorship to speed up the bug fix or feature request (example)
Description
I am trying to use the new oas3 annotations introduced in #9775 using the 5.3.1-SNAPSHOT version and the <oas3>true</oas3> option. I ran into the issue that the request body is not getting parsed correctly, the fields of the LogEntry object are all null. Adding the @org.springframework.web.bind.annotation.RequestBody annotation to the generated code like this PR does fixes it.
The main goal of this issue is to raise awareness for this problem and the existing PR that fixes it.
openapi-generator version
5.3.1-SNAPSHOT
OpenAPI declaration file content or url
openapi: "3.0.2"info:
title: titledescription: descriptionversion: "1.0"paths:
"/app/log":
summary: Add a new log entrypost:
tags:
- logoperationId: logrequestBody:
$ref: '#/components/requestBodies/LogBody'responses:
'200':
description: ok, the entry was NOT created because the level was too low'201':
description: created'401':
$ref: '#/components/responses/UnauthorizedError'components:
responses:
UnauthorizedError:
description: Access token is missing or invalidrequestBodies:
LogBody:
required: truecontent:
application/json:
schema:
$ref: '#/components/schemas/LogEntry'schemas:
LogEntry:
type: objectproperties:
level:
type: stringenum:
- debug
- info
- warning
- errormessage:
type: stringrequired:
- level
- message
Generation Details
I am using the maven plugin, here is the configuration:
Bug Report Checklist
Description
I am trying to use the new oas3 annotations introduced in #9775 using the 5.3.1-SNAPSHOT version and the
<oas3>true</oas3>
option. I ran into the issue that the request body is not getting parsed correctly, the fields of theLogEntry
object are all null. Adding the@org.springframework.web.bind.annotation.RequestBody
annotation to the generated code like this PR does fixes it.The main goal of this issue is to raise awareness for this problem and the existing PR that fixes it.
openapi-generator version
5.3.1-SNAPSHOT
OpenAPI declaration file content or url
Generation Details
I am using the maven plugin, here is the configuration:
Related issues/PRs
#9775
#10766
Suggest a fix
Merge #10766
The text was updated successfully, but these errors were encountered: