To skip using TypeAdapters, I would make POJO do a null check when calling the setter method.
Or look
@JsonInclude(value = Include.NON_NULL)
Annotations should be at the class level, not at the method level.
@JsonInclude(Include.NON_NULL) //or Include.NON_EMPTY, if that fits your use case public static class RequestPojo { ... }
For Deserialise, you can use the following at the class level.
@JsonIgnoreProperties (ignoreUnknown = true)
source share