You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As things stand, depending on auto-configuration ordering, whether or not you have Jackson's XML format on the classpath, and when precisely the Jackson2ObjectMapperBuilder is used, you may or may not get an XML mapper. Perhaps that's OK and we expect consumers of the builder to always call createXmlMapper(true|false) to meet their needs but I'm not sure that the current behaviour is intentional and I think it could be a bit brittle and confusing. #17425 is an example of that.
The text was updated successfully, but these errors were encountered:
wilkinsona
changed the title
Review mutation of auto-configured Jackson2ObjectMapperBuilder
Mutation of Jackson2ObjectMapperBuilder in one injection point may affect subsequent usages
Jul 12, 2019
Jackson2ObjectMapperBuilder
is stateful and we have a few places where it's injected and mutated:spring-boot/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/http/JacksonHttpMessageConvertersConfiguration.java
Lines 63 to 68 in 3c28622
spring-boot/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jackson/JacksonAutoConfiguration.java
Lines 102 to 107 in 3c28622
spring-boot/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/rsocket/RSocketStrategiesAutoConfiguration.java
Lines 76 to 85 in 3c28622
As things stand, depending on auto-configuration ordering, whether or not you have Jackson's XML format on the classpath, and when precisely the
Jackson2ObjectMapperBuilder
is used, you may or may not get an XML mapper. Perhaps that's OK and we expect consumers of the builder to always callcreateXmlMapper(true|false)
to meet their needs but I'm not sure that the current behaviour is intentional and I think it could be a bit brittle and confusing. #17425 is an example of that.The text was updated successfully, but these errors were encountered: