I have a simple application with Spring Boot and Jetty. I have a simple controller returning an object which has a Java 8 ZonedDateTime
:
public clas
For Jackson 2.10
and above,
parent pom.xml
com.fasterxml.jackson
jackson-bom
2.10.3
pom
import
module pom.xml
com.fasterxml.jackson.datatype
jackson-datatype-jsr310
JsonMapper creation, possibly in your @Configuration
class
@Bean
public JsonMapper jsonMapper() {
return JsonMapper.builder()
.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false)
.addModule(new JavaTimeModule())
.build();
}
Further reading: