For Spring Boot 1.2.3, how to set ignore null value in JSON serialization?

前端 未结 6 1970

In the Spring Boot 1.2.3, we can customize the Jackson ObjectMapper via properties file. But I didn\'t find a attribute can set Jackson ignore null value when serialization

6条回答
  •  萌比男神i
    2020-12-18 19:07

    For Spring Boot 1.4.x, you can include the following line to your application.properties

    spring.jackson.default-property-inclusion=non_null

提交回复
热议问题