-
Bug
-
Resolution: Done
-
Critical
-
3.0.14.Final
-
None
-
-
Compatibility/Configuration, User Experience
In line 108 in ResteasyJackson2Provider starting with version 3.0.14 you call this:
endpoint = _configForReading(mapper, annotations, type);
compared to this in 3.0.13:
endpoint = _configForReading(mapper, annotations);
So you added a 3rd parameter: the type you want to read. But if you look at the matching method declaration in com.fasterxml.jackson.jaxrs.base.ProviderBase you'll find the 3rd parameter is actually a "default view" class - not the type to read:
_configForReading(MAPPER mapper, Annotation[] annotations, Class<?> defaultView);
So what happens if you actually add the third parameter that is != null Jackson will check each field it deserializes for @JsonView annotations and if one is present validate assignability to the provided parameter. It it is not assignable it will skip the field.
So bottom line this will work as long as you don't have any @JsonView annotations present on the DTO you want to read from json. If you have @JsonView annotations on a few fields it will deserialize them all to null because most likely non of the annotation values will be assignable to the type you provide as 3rd parameter.
I think just either replacing
endpoint = _configForReading(mapper, annotations, type);
with
endpoint = _configForReading(mapper, annotations, null);
or actually supporting the @JsonView feature directly and provide an actual default view as parameter should fix the issue.
- is cloned by
-
JBEAP-5435 (7.1.0) Changes to ResteasyJackson2Provider in 3.0.14.Final breaks Jackson2 @JsonView behavior
- Verified
- is incorporated by
-
JBEAP-5444 (7.0.z) RESTEASY-1366 - Changes to ResteasyJackson2Provider in 3.0.14.Final breaks Jackson2 @JsonView behavior
- Verified