How can Jackson be configured to ignore a field value during serialization if that field\'s value is null.
For example:
public class SomeClass {
This has been troubling me for quite some time and I finally found the issue. The issue was due to a wrong import. Earlier I had been using
com.fasterxml.jackson.databind.annotation.JsonSerialize
Which had been deprecated. Just replace the import by
import org.codehaus.jackson.map.annotate.JsonSerialize;
import org.codehaus.jackson.map.annotate.JsonSerialize.Inclusion;
and use it as
@JsonSerialize(include=Inclusion.NON_NULL)