Jackson use JsonSerialize.Inclusion.NON_NULL except for one class

前端 未结 3 878
死守一世寂寞
死守一世寂寞 2021-02-05 06:48

I normally use objectMapper.setSerializationInclusion(JsonSerialize.Inclusion.NON_NULL) because I never want the null values of my classes serialized. Except now I have a specif

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-05 07:24

    With Jackson 1.9 is used @JsonSerialize(include= JsonSerialize.Inclusion.ALWAYS)

    @JsonSerialize(include=Include.ALWAYS) did not compile.

提交回复
热议问题