-
-
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
Deserialise from Object (using Creator methods) returns field name instead of value #1853
Comments
One quick note: usage of But it sounds like there is something else going on here as well; thank you for reporting the problem. |
Thank you for the comment. After I've removed @JsonCreator on constructor and put another one into DEFAULT mode, test started to work on both 2.9.1 and 2.9.2 versions.
UPD: In default mode the @JsonProperty("name") should remain on the constructor or on the factory method for the test to work. (v2.9.2)
|
Ok, I hope to have time to figure out what gives wrt error reporting / reading of field name. That seems wrong at any rate. So I'll keep this open for a bit still. |
I can reproduce the problem with example. Looks like "property-based" creator is not discovered (or not retained), and only delegating one remains. Further, I will add a check for latter, which will help avoid odd error like this (because debugging problems if there were more properties would be quite confusing). And then hopefully figure out why properties-based creator is not retained, and if it can be made to work. |
…lizer` (wrt `JsonToken.FIELD_NAME`)
Interesting that part about using |
Looks like difference has to do with explicit vs implicit typing, leading to different interpretation: in one case (working), we have "single-string" creator; in other more general "delegating". |
Looks like handling did differ, had to add more checking in explicit case. Hope to rewrite this area in 3.0, however; code gotten complicated, brittle. |
Demonstrated by the following test:
Which is green with 2.9.1 and fails with 2.9.2:
The text was updated successfully, but these errors were encountered: