Spring Boot issues serializing java.time.LocalDateTime with Jackson to return ISO-8601 JSON timestamps?

后端 未结 3 1581
渐次进展
渐次进展 2021-02-13 02:48

I\'m working on converting some models in a spring-boot REST API app to use java 8\'s java.time.LocalDateTime instead of joda\'s DateTime. I want the t

3条回答
  •  情话喂你
    2021-02-13 03:49

    The error occurs because you mix versions of Jackson. You are using version 1.3.6.RELEASE of Spring Boot. If you would migrate to Spring Boot version 2.x.x.RELEASE then you can replace the com.fasterxml.jackson.datatype dependency by a spring-boot-starter-json dependency. In this way you let Spring Boot take care of the correct Jackson version.

    
        org.springframework.boot
        spring-boot-starter-json
    
    

提交回复
热议问题