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
It's a valid use case that reuse the same configuration over different data formats
ObjectMapperjsonObjectMapper = newObjectMapper();
// do some configuration ...ObjectMappercborObjectMapper = jsonObjectMapper.copyWith(newSmileFactory());
Spring Boot configuration take affect only json format, this will make it possible to all format, for example
@Bean@ConditionalOnMissingBean(value = MappingJackson2CborHttpMessageConverter.class)
// other conditionsMappingJackson2CborHttpMessageConvertermappingJackson2CborHttpMessageConverter(ObjectMapperobjectMapper) {
returnnewMappingJackson2CborHttpMessageConverter(objectMapper.copyWith(newCBORFactory()));
}
One thing to note: this would not work for all format: XML (jackson-dataformat-xml) for example requires XmlMapper subtype. But it would work for most formats so that's probably useful enough.
It's a valid use case that reuse the same configuration over different data formats
Spring Boot configuration take affect only json format, this will make it possible to all format, for example
spring-projects/spring-boot#27319 (comment)
The text was updated successfully, but these errors were encountered: