-
-
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
Deserialization ignores other Object fields when Object or Array value used for enum #3369
Comments
Part of the problem might be right here:
which you should first remove to see what is actually going on. It's bit of an anti-pattern for tests but very widely used. But I do agree that it looks like something odd might be happening. |
It's same with/without JsonIgnoreProperties |
Thank you for verifying. I am now looking into this issue. And your analysis on The main question really is whether to fail on non-scalar, or consider them same as Empty String. |
Describe the bug
Objectmapper deserialization ignore other field when Object or Array field used for enum
Version information
2.13.1
To Reproduce
Expected behavior
3rd and 4th conversion should either fail or should de-serialize person and age.
Expected output:
Actual output:
Additional context
Its similar to #1859 one.
I could fix the issue by adding, p.skipChildren();
in FactoryBasedEnumDeserializer after line 151.
// 12-Oct-2021, tatu: We really should only get here if and when String
// value is expected; otherwise Deserializer should have been used earlier
value = p.getValueAsString();
p.skipChildren();
The text was updated successfully, but these errors were encountered: