How can Jackson be configured to ignore a field value during serialization if that field\'s value is null.
For example:
public class SomeClass {
Case one
@JsonInclude(JsonInclude.Include.NON_NULL)
private String someString;
Case two
@JsonInclude(JsonInclude.Include.NON_EMPTY)
private String someString;
If someString
is null, it will be ignored on both of cases.
If someString
is "" it just only be ignored on case two.
The same for List = null
or List.size() = 0