-
-
Notifications
You must be signed in to change notification settings - Fork 517
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NPE in RequestBodyService#buildRequestBody when using javadoc #2089
Comments
@zman0900 |
Not reproducible. |
@bnasslahsen please re-open this, it can be reproduced. Here is a small demo project: https://github.com/zman0900/springdoc-2089-demo Important part is in the DemoController#update method. When swagger's @RequestBody annotation is used on a parameter without setting the description field, the error in this issue happens. It works if I remove swagger's @RequestBody entirely, but then the swagger UI doesn't document the expected schema. It also works if I add the description field, but then the string from the javadoc must be duplicated. Finally, it works if I downgrade to 1.6.12. |
…n field of RequestBody is null and there is a javadoc description. Fixes springdoc#2089
…n field of RequestBody is null and there is a javadoc description. Fixes springdoc#2089
…n field of RequestBody is null and there is a javadoc description. Fixes springdoc#2089
Thanks. Any plan to release another 1.6.x version for those of us still stuck on Spring Boot 2, or will this only be in next 2.x release? |
both will be released by the end of this week |
Awesome, thanks |
Describe the bug
Using springdoc 1.6.13 or 1.6.14, with the javadoc plugin and a controller method that has a parameter annotated with
@RequestBody
and javadoc for that parameter, accessing Swagger UI shows 500 error and log shows NullPointerException.The stack trace
This seems to happen because
org.springdoc.core.RequestBodyService#buildRequestBody
is called with non-nullrequestBody
parameter, but withrequestBodyInfo
parameter containing null for itsrequestBody
field. The only apparent caller of thatbuildRequestBody
method iscalculateRequestBodyInfo
in the same class, and it does not setrequestBody
inrequestBodyInfo
until after making the call.To Reproduce
Steps to reproduce the behavior:
Expected behavior
Expecting Swagger UI to function as it does when using springdoc 1.6.12.
The text was updated successfully, but these errors were encountered: