Spring Boot LocalDate field serialization and deserialization

前端 未结 4 1376
孤独总比滥情好
孤独总比滥情好 2020-12-17 01:37

On spring boot 1.2.3.RELEASE with fasterxml what is the correct way of serializing and de-serializing a LocalDate field to iso date formatted string?

I\'ve tried:

4条回答
  •  天涯浪人
    2020-12-17 02:25

    Actually, it works if you just specify the dependency in the pom.xml.

    With this, all my LocalDate fields automatically use the ISO format, no need to annotate them:

    
    
        com.fasterxml.jackson.datatype
        jackson-datatype-jsr310
    
    

    Tested on Spring Boot 1.5.7.

提交回复
热议问题