Ignore null value Jackson JSON serialization

Ignore null value Jackson JSON serialization

If you are using Jackson mapper to serialize data and want to ignore null value during serialization please use below:

@JsonSerialize(include=JsonSerialize.Inclusion.NON_NULL)

Above will work for Jackson version >1.9

Other solution if above doesn’t work:

OR:

For more information on Jackson please use this tutorial

Leave a Reply

Your email address will not be published. Required fields are marked *