-
Notifications
You must be signed in to change notification settings - Fork 38.3k
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
Add ParameterNamesModule to "well known" jackson modules #27511
Add ParameterNamesModule to "well known" jackson modules #27511
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ParameterNamesModule
looks useful for common use case, so I will merge those changes.
I will raise your point about enabling service loader instead with the team. Well-know modules can be enabled via this mechanism so if it does not introduce side effects, that could indeed be an alternative.
Notice such change was also discussed in #17886, and at that time we decided to not include it, but nowadays I expect developers to use much more constructor binding, so using this default makes sense. Inclusion in the Release Candidate will give us the opportunity to revise that choice if we have feedback mentioning unwanted side effects. |
Jesus, this is kind of breaking change. This module can cause |
@floatdrop See spring-projects/spring-boot#40036 for a case that sounds close to yours. |
Kind of the same – we have some classes with Excluding |
@floatdrop hey, unless you want property names to appear different in json than they are in the pojo, you can just delete those annotations. Jackson can just read constructor parameter names and getters via reflection. Never had a problem like that |
Also, I'm surprised to see that
org.springframework.http.converter.json.Jackson2ObjectMapperBuilder#findModulesViaServiceLoader
is nottrue
by default. Why not always just let it scan the classpath, seems likefindWellKnownModules
does the same but manually.