Skip to content

Commit 0fbaf8f

Browse files
committed
Merge branch '3.2.x' into 3.3.x
Closes gh-42787
2 parents 34eade3 + 788fe61 commit 0fbaf8f

File tree

1 file changed

+2
-1
lines changed
  • spring-boot-project/spring-boot-docs/src/docs/antora/modules/how-to/pages

1 file changed

+2
-1
lines changed

spring-boot-project/spring-boot-docs/src/docs/antora/modules/how-to/pages/spring-mvc.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@ Such customizer beans can be ordered (Boot's own customizer has an order of 0),
118118
Any beans of type `com.fasterxml.jackson.databind.Module` are automatically registered with the auto-configured `Jackson2ObjectMapperBuilder` and are applied to any `ObjectMapper` instances that it creates.
119119
This provides a global mechanism for contributing custom modules when you add new features to your application.
120120

121-
If you want to replace the default `ObjectMapper` completely, either define a `@Bean` of that type and mark it as `@Primary` or, if you prefer the builder-based approach, define a `Jackson2ObjectMapperBuilder` `@Bean`.
121+
If you want to replace the default `ObjectMapper` completely, either define a `@Bean` of that type or, if you prefer the builder-based approach, define a `Jackson2ObjectMapperBuilder` `@Bean`.
122+
When defining an `ObjectMapper` bean, marking it as `@Primary` is recommended as the auto-configuration's `ObjectMapper` that it will replace is `@Primary`.
122123
Note that, in either case, doing so disables all auto-configuration of the `ObjectMapper`.
123124

124125
If you provide any `@Beans` of type `MappingJackson2HttpMessageConverter`, they replace the default value in the MVC configuration.

0 commit comments

Comments
 (0)