I have a json entry like :
{
"name" : "tom"
"age" : 10
}
Some json entries have an additional field of address
.
I'm trying to read it to a POJO defined as follows :
public class StudentDetails {
@NonNull
private final String name;
@NonNull
private final int age;
private final String address;
I'm unable to deserialise this. What Jackson annotation can I use to accomplish this ? Some of the entries will have the field of address
whereas others won't.
Tried using @NonNull, @Nullable, @JsonIclude, @JsonIgnoreProperities, Optional<>