I\'m trying to configure Jackson to show JSR 310 instants in ISO 8601 format.
@Configuration
class Jackson {
@Bean
static ObjectMapper objectMapper(
You can (and probably should) you RepositoryRestConfigurerAdapter
(in Spring Data Rest 2.4) or RepositoryRestMvcConfiguration
which expose the configureObjectMapper
method.
@Configuration
class RepositoryRestAdapterConfiguration extends RepositoryRestConfigurerAdapter {
@Override
public void configureJacksonObjectMapper(ObjectMapper objectMapper) {
objectMapper.registerModule(new JavaTimeModule());
objectMapper.disable( SerializationFeature.WRITE_DATES_AS_TIMESTAMPS );
}
}