-
-
Notifications
You must be signed in to change notification settings - Fork 523
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
OpenAPIService is using ObjectMapper without configured modules since SpringDoc 1.6.7 #1655
Labels
bug
Something isn't working
Comments
Let me know, if it's OK for you with the last SNAPSHOT. |
bnasslahsen
added a commit
that referenced
this issue
May 23, 2022
…ed modules since SpringDoc 1.6.7 #1655
this patch indeed resolved my issue. Thank you very much. =)) PS: Based on implementation, isn't this fix also introducting again issue #1525 ? (I'm really sorry as in my "bug description" I wanted to mention it but by mistake provided wrong link) |
The related test, was failing indeed. Should be better now. |
bnasslahsen
added a commit
that referenced
this issue
May 23, 2022
…ed modules since SpringDoc 1.6.7 #1655
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug description
Originally in
OpenAPIService.build(Locale locale)
ObjectMapper
was obtained viaJson.mapper()
.This behaviour was changed in SpringDoc 1.6.7 in order to resolve #1525 to
new ObjectMapper()
. The problem is that this way obtained instance ofObjectMapper
has no longer registeredJavaTimeModule
, Swagger v3DeserializationModule
and mixins.In my application I have
OperationCustomizer
that adds to all REST operations schema for 5xx responses that are produced by@ControllerAdvice
. In 5xx response schema I'm usingInstant
and sinceJavaTimeModule
is absent, attempt to serializeopenAPI
to JSON and deserialize it producesJsonProcessingException
. This exception is then logged withWARN
level and suppressed resulting incalculatedOpenAPI = null
which then later in execution is causingNullPointerException
(see output log below)Sample code to Reproduce
Code snippet abowe works for SpringDoc 1.6.6 or older. Since SpringDoc 1.6.7
/v3/api-docs
endpoint fails with HTTP 500 response due to problem described above.The text was updated successfully, but these errors were encountered: