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
If you are reporting a bug, please help to speed up problem diagnosis by providing as much information as possible:
A clear and concise description of what the bug is: the title of an issue is not enough
The current behavior seems to parse whether or not a request body is optional from one of several values, one of which is the spring boot @RequestBody annotation. The problem is, even if you set required to false, springdoc-openapi still registers it as required. I've looked at the code and I suspect the reason is that it simply checks if the @RequestBody annotation exists but doesn't check the required value.
To Reproduce
Steps to reproduce the behavior:
What version of spring-boot you are using?
2.2.6
What modules and versions of springdoc-openapi are you using?
Describe the bug
The current behavior seems to parse whether or not a request body is optional from one of several values, one of which is the spring boot
@RequestBody
annotation. The problem is, even if you set required tofalse
,springdoc-openapi
still registers it as required. I've looked at the code and I suspect the reason is that it simply checks if the@RequestBody
annotation exists but doesn't check therequired
value.To Reproduce
Steps to reproduce the behavior:
2.2.6
org.springdoc:springdoc-openapi-ui:1.3.4
org.springdoc:springdoc-openapi-kotlin:1.3.4
Sorry I don't understand the question
You can configure any POST endpoint and set the
@RequestBody(required = false)
and it will still display the request body as required.In the screenshots section, I've attached how the UI still displays the body as required, even though its set to false
Expected behavior
The UI should display the request body as not required.
Screenshots
If applicable, add screenshots to help explain your problem.
The text was updated successfully, but these errors were encountered: