-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@JsonUnwrapped causes deserializer to silently ignore unknown properties #1061
Comments
Another bug in unwrapped property handling (in both Note for anyone else encountering this: as a hacky partial work-around for the first bug, this means you may be able to add a |
I think this may dup of #650? Yes, unwrapped handling has no way of determining if something is or is not unknown, because deserializers are not required to indicate if such set is limited or not: for example, use of Whether this behavior may or may not be changed is not clear at this point; from internal perspective this may be a hard limitation. |
Yes, I looked for an existing issue and didn't find that one, but it is a dup. |
Quite understandable, there are a few issues and original is quite old. |
Adding
@JsonUnwrapped
to any field in a class prevents anUnrecognizedPropertyException
from being thrown, ever, regardless ofDeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES
or@JsonIgnoreProperties
. (As of databind version 2.5.4.)If you look at
UnwrappedPropertyHandler.processUnwrapped(JsonParser, DeserializationContext, Object, TokenBuffer)
, you'll see that it iterates over the unwrapped properties and sets each one based on properties found in theTokenBuffer
. Nowhere does it check that every property stashed in theTokenBuffer
was found in (at least) one of the unwrapped properties.The text was updated successfully, but these errors were encountered: