JacksonFeature breaks JsonIgnoreProperties

Viewed 990

I have pojo's like these:

@JsonIgnoreProperties(ignoreUnknown = true)
public class SNAPIResponse {

    public String status;
    public String message;
    public int errorCode;

    public ConsumerProfile consumerProfile;

    @JsonIgnoreProperties(ignoreUnknown = true)
    public static class ConsumerProfile {
        public String accountId;
    }
}

and my Jersey client works just fine even though the ConsumerProfile responses contain a lot of extra fields.

Then I add a line:

client.register(JacksonFeature.class);

to my Jersey Client setup. And after that, the ignore's don't work anymore:

Unrecognized field "authService" (Class com.xyz..SNAPIResponse$ConsumerProfile), not marked as ignorable

Why?

1 Answers
Related