serialize/deserialize java 8 java.time with Jackson JSON mapper

后端 未结 17 1147
隐瞒了意图╮
隐瞒了意图╮ 2020-11-22 15:56

How do I use Jackson JSON mapper with Java 8 LocalDateTime?

org.codehaus.jackson.map.JsonMappingException: Can not instantiate value of type [simple t

17条回答
  •  清酒与你
    2020-11-22 16:58

    For those who use Spring Boot 2.x

    There is no need to do any of the above - Java 8 LocalDateTime is serialised/de-serialised out of the box. I had to do all of the above in 1.x, but with Boot 2.x, it works seamlessly.

    See this reference too JSON Java 8 LocalDateTime format in Spring Boot

提交回复
热议问题