I\'m trying to configure Jackson to show JSR 310 instants in ISO 8601 format.
@Configuration
class Jackson {
@Bean
static ObjectMapper objectMapper(
After some experimentation, I found that if I annotate my "setter" (setter injection) with it will get run. This is a little simpler, and cleaner than using field injection and @PostConstruct
.
@Configuration
class Jackson {
@Autowired
void configureObjectMapper( final ObjectMapper objectMapper ) {
objectMapper.disable( SerializationFeature.WRITE_DATES_AS_TIMESTAMPS );
}
}