I am using spring-boot 1.2.1.RELEASE with jackson 2.6.2, including the jsr310 data type. I am using the @SpringBootApplication annotation to run my Spring application. I have
spring.jackson.serialization.write_dates_as_timestamps = false
installed in my application application.properties (which, as I know, is being read because I tested it with banner = false).
And yet java.time.LocalDate is still serializing as an array of integers. I do not use @EnableWebMvc.
It looks like if I add a tag
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd")
into my LocalDate variable, then it works. But I thought it was automatic with the above set of properties. Plus, if I remember correctly (since then I just decided to work with the whole array), which worked only with serialization and not with deserialization (but I can’t honestly remember whether this last part is true).
source
share