Clarify why @Primary is recommended when defining your own ObjectMapper that replaces JacksonAutoConfiguration's #42598
Labels
type: documentation
A documentation update
Milestone
The

JacksonAutoConfiguration
class takes care of creating a defaultObjectMapper
bean. The conditions based on which this configuration gets applied can be documented in a better way. For example, Spring docs link is confusing. As per this, both@Bean
and@Primary
are needed to replace the defaultObjectMapper
:In reality, the
@Primary
is not necessary, just creating aObjectMapper
bean results in the default jacksonObjectMapper
bean not being created. This can result in problems as described in #22403.This behaviour should be mentioned clearly in the documentation. Also, the Javadoc for
JacksonAutoConfiguration
states this behaviour and this clarity should be present in the documentation as well.The text was updated successfully, but these errors were encountered: