[ACCEPTED]-Jackson: Ignore Json configuration value-jackson

Accepted answer
Score: 70

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.

Score: 2

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...
}

More Related questions