Yes.

Also, with 2.8, there is a programmatic alternative to per-class
`@JsonIgnoreProperties` annotation:

      mapper.configOverride(MyPOJO.class)
         .setIgnorals(JsonIgnoreProperties.Value.forIgnoreUnknown(false));
which can be used to disable or enable exception throwing on specific class.

-+ Tatu +-

On Thu, Sep 8, 2016 at 3:53 AM, Nate Bauernfeind <[email protected]
> wrote:

> I'm going to direct you here: http://stackoverflow.com/questions/5455014/
> ignoring-new-fields-on-json-objects-using-jackson
>
> There are two answers,
> 1. annotate your models: '@JsonIgnoreProperties(ignoreUnknown = true)'
> 2. Ignore unknown properties globally for an entire mapper:
> objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES,
> false);
>
> On Thu, Sep 8, 2016 at 1:59 AM <[email protected]> wrote:
>
>> Version used:
>> com.fasterxml.jackson.core:jackson-annotations:2.7.0
>> com.fasterxml.jackson.core:jackson-core:2.7.1
>> com.fasterxml.jackson.core:jackson-databind:2.7.1
>>
>>
>> Every time the server introduces a new property and it hasn't been
>> communicated to me, my app breaks due to this exception.
>> Shouldn't all the properties be ignored by default?
>> For example, a User class has "name" and "gender" and it has been working
>> fine. Why should my app break when the server returns a new property
>> "religion" for example?
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "jackson-user" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To post to this group, send email to [email protected].
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "jackson-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"jackson-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to