Closed
Description
Spring Boot version: 2.1.2.RELEASE
The Jackson2ObjectMapperBuilder's modulesToInstall documentation says
*Specify one or more modules to be registered with the {@link ObjectMapper}.
* <p>Modules specified here will be registered after
* Spring's autodetection of JSR-310 and Joda-Time, or Jackson's
* finding of modules (see {@link #findModulesViaServiceLoader}),
* allowing to eventually override their configuration.
But when we have this config:
@Bean
public ObjectMapper restApiObjectMapper(final Jackson2ObjectMapperBuilder builder,
final LenientOffsetDateTimeDeserializer offsetDateTimeDeserializer) {
final JavaTimeModule javaTimeModule = new JavaTimeModule();
javaTimeModule.addDeserializer(OffsetDateTime.class, offsetDateTimeDeserializer);
builder.modulesToInstall(javaTimeModule);
builder.failOnUnknownProperties(false);
builder.featuresToDisable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
return builder.build();
}
It is expect that the custom DateTimeDeserializer will get picked up. But still the default one's are used and leading to json parse errors.