Jackson: JsonInclude how to add Multiple JsonInclude annotation type

后端 未结 1 1254
死守一世寂寞
死守一世寂寞 2021-01-07 23:01

How can I tell a class to include only NON_EMPTY and NON_NULL values only, Using

@JsonInclude(Include.NON_NULL)
@JsonInclude(Include.NON_EMPTY)
public class         


        
1条回答
  •  囚心锁ツ
    2021-01-07 23:09

    "Null is always considered empty" - Jackson's site

    So the NON_EMPTY rule covers both cases..

    0 讨论(0)
提交回复
热议问题