[ACCEPTED]-Jackson: Ignore Json configuration value-jackson
Accepted answer
You can use annotation @JsonIgnoreProperties
; if it's just one 4 value you want to skip, something like:
@JsonIgnoreProperties({"externalId"})
or 3 to ignore anything that can't be used:
@JsonIgnoreProperties(ignoreUnknown=true)
There 2 are other ways to do it too, for rest check 1 out FasterXML Jackson wiki.
Also we can use mapper.enable(DeserializationFeature.FAIL_ON_IGNORED_PROPERTIES); instead 2 @JsonIgnoreProperties(ignoreUnknown=true)
but 1 for particular property we can use
@JsonIgnoreProperties({"externalId"})
public class Segment {
private String id;
private String name;
private boolean shouldInform;
// getter and setters here...
}
Source:
stackoverflow.com
More Related questions
Cookie Warning
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.