When using the objectmapper on an object you can run into Unrecognized field “”. This is due to the field not being found.
You can use an easy annotation to ignore every property you haven’t defined in your json string. This is very useful if you are only looking for a couple of properties in the json. This will only get what you ned and won’t write the whole mapping. Use the @JsonIgnoreProperties annotation and set ignoreUnknown to true.
@JsonIgnoreProperties(ignoreUnknown = true)
public Class MyObject {
private String name;
}
More information in the source: https://github.com/FasterXML/jackson-annotations