How to ignore a field with Jackson

In Jackson, we can use @JsonIgnore to ignore a single field, @JsonIgnoreProperties to ignore multiple fields and @JsonIgnoreType to ignore a specified type during JSON serialization and deserialization. Table of contents: 1. Setup Jackson 2. Jackson @JsonIgnore – Ignores a field 3. Jackson @JsonIgnoreProperties – Ignores multiple fields 4. Jackson @JsonIgnoreType – Ignores a specified …

Read more

How to ignore null fields with Jackson

In Jackson, we can use @JsonInclude(JsonInclude.Include.NON_NULL) to ignore the null fields during serialization. Table of contents: 1. Jackson default include null fields 2. Ignore all null fields globally 3. Ignore null fields (Class Level) 4. Ignore null fields (Field Level) 5. Download Source Code 6. References P.S Tested with Jackson 2.17.0 1. Jackson default include …

Read more