-
Notifications
You must be signed in to change notification settings - Fork 41.6k
Clarify Javadoc of Customizer interfaces about overriding behavior #46938
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
Conversation
…rriding behavior Signed-off-by: Seokjae Lee <[email protected]>
Thanks for the proposal, but I don't think this is a change that we should make. Not in isolation any way. There are many other customizers whose javadoc describes them similarly. If The various customizers are, generally speaking, documented something like this:
Perhaps we can just say something like this instead:
Are you interested in updating your PR along these lines for each |
Hello @wilkinsona 🙂 To agree with your opinion and maintain consistency, I think it would be best to reflect every Would you like to do that in this PR please? |
Great. An update to this PR that makes that change to all |
The previous wording suggested that customizations always retain default auto-configuration. Rephrased to indicate that configuration can be fine-tuned, which more accurately reflects that some builder methods may override or replace defaults. Signed-off-by: Seokjae Lee <[email protected]>
I committed changes on ff43c5e to modify all Also I changed PR title too 🙂 |
The previous wording suggested that customizations always retain default auto-configuration. Rephrased to indicate that configuration can be fine-tuned, which more accurately reflects that some builder methods may override or replace defaults. See gh-46938 Signed-off-by: Seokjae Lee <[email protected]>
Thanks very much for making your first contribution to Spring Boot, @doljae. |
Motivation
To prevent misunderstandings and make the behavior of Jackson2ObjectMapperBuilder more transparent when used through
Jackson2ObjectMapperBuilderCustomizer
.Description
The existing Javadoc of
Jackson2ObjectMapperBuilderCustomizer
suggests that customizations retain the default auto-configuration while extending it. However, depending on which methods ofJackson2ObjectMapperBuilder
are invoked, the default configuration may actually be overridden or replaced instead of merely extended.This PR updates the Javadoc to explicitly note this possibility, so that developers are aware that certain builder methods (e.g., modules, dateFormat, propertyNamingStrategy) may discard or replace auto-configured settings.
Changes
Added a clarification line in the Javadoc of
Jackson2ObjectMapperBuilderCustomizer
to indicate that some customizations may override or replace default auto-configuration.