How can Jackson be configured to ignore a field value during serialization if that field\'s value is null.
For example:
public class SomeClass {
If you're trying to serialize a list of object and one of them is null you'll end up including the null item in the JSON even with
mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
will result in:
[{myObject},null]
to get this:
[{myObject}]
one can do something like:
mapper.getSerializerProvider().setNullValueSerializer(new JsonSerializer
TIP: If you're using DropWizard you can retrieve the ObjectMapper
being used by Jersey using environment.getObjectMapper()