Hi,

I have this simple project with:

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-web</artifactId>
</dependency>

I am trying to make LocalDateTime to be written in ISO format.

I tried to add spring.jackson.serialization.write-dates-as-timestamps=false

but it made no difference.

Looking at Jackson2ObjectMapperBuilderCustomizer o noticed that JavaTimeModule was not loaded.

SpringBoot jackson-datatype-jsr310 not loaded on Auto Configured ObjectMapper when Jackson2ObjectMapperBuilderCustomizer is loaded

What am I missing?

As reference here is a simple project.

https://github.com/ffroliva/jackson-load-modules-issue

Comment From: wilkinsona

Looking at Jackson2ObjectMapperBuilderCustomizer I noticed that JavaTimeModule was not loaded

The modules are not loaded until the ObjectMapper has been created by the builder and is being configured.

LocalDateTimeControllerRestTemplateIntegrationTest is failing because you are creating your own TestRestTemplate builder rather than injecting it. This means that it is using Jackson in its default configuration. If you @Autowired TestRestTemplate into your test, it will be preconfigured to use the auto-configured ObjectMapper with the JavaTimeModule registered.

If you have any further questions, please follow up on Stack Overflow or Gitter. As mentioned in the guidelines for contributing, we prefer to use GitHub issues only for bugs and enhancements.