Skip to content

Conversation

doljae
Copy link
Contributor

@doljae doljae commented Aug 22, 2025

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 of Jackson2ObjectMapperBuilder 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.

@wilkinsona
Copy link
Member

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 Jackson2ObjectMapperBuilderCustomizer requires clarification, then the others should be changed in the same way otherwise the difference in the descriptions could imply a difference in behavior.

The various customizers are, generally speaking, documented something like this:

Callback interface that can be implemented by beans wishing to customize the […] while retaining its default auto-configuration.

Perhaps we can just say something like this instead:

Callback interface that can be implemented by beans wishing to customize the […] to fine-tune its auto-configuration.

Are you interested in updating your PR along these lines for each …Customizer callback interface?

@wilkinsona wilkinsona added the status: waiting-for-feedback We need additional information before we can continue label Aug 22, 2025
@doljae
Copy link
Contributor Author

doljae commented Aug 22, 2025

Hello @wilkinsona 🙂

To agree with your opinion and maintain consistency, I think it would be best to reflect every ...Customizer callback interface's javadoc.

Would you like to do that in this PR please?

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Aug 22, 2025
@wilkinsona
Copy link
Member

Great. An update to this PR that makes that change to all …Customizer interfaces would be much appreciated.

@wilkinsona wilkinsona added status: waiting-for-feedback We need additional information before we can continue and removed status: feedback-provided Feedback has been provided labels Aug 22, 2025
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]>
@doljae doljae changed the title Clarify Javadoc of Jackson2ObjectMapperBuilderCustomizer about overriding behavior Clarify Javadoc of Customizer interfaces about overriding behavior Aug 22, 2025
@doljae
Copy link
Contributor Author

doljae commented Aug 22, 2025

I committed changes on ff43c5e to modify all ...Customizer callback interface's javadoc.

Also I changed PR title too 🙂

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Aug 22, 2025
@wilkinsona wilkinsona added type: documentation A documentation update and removed status: waiting-for-triage An issue we've not yet triaged status: feedback-provided Feedback has been provided labels Aug 22, 2025
@wilkinsona wilkinsona added this to the 3.4.x milestone Aug 22, 2025
@wilkinsona wilkinsona self-assigned this Aug 22, 2025
@wilkinsona wilkinsona modified the milestones: 3.4.x, 3.4.10 Aug 22, 2025
wilkinsona pushed a commit that referenced this pull request Aug 22, 2025
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]>
@wilkinsona
Copy link
Member

Thanks very much for making your first contribution to Spring Boot, @doljae.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: documentation A documentation update

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants