-
-
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
Bug in polymorphic deserialization with @JsonCreator
, @JsonAnySetter
, JsonTypeInfo.As.EXTERNAL_PROPERTY
#3045
Comments
My Jackson version, for the test, is 2.12.0 |
Not sure what the problem might be, thank you for providing the reproduction code. I hope to have a look in near future but this may take a while. The difference between |
@JsonAnySetter
, JsonTypeInfo.As.EXTERNAL_PROPERTY
@JsonAnySetter
, JsonTypeInfo.As.EXTERNAL_PROPERTY
@JsonCreator
, JsonTypeInfo.As.EXTERNAL_PROPERTY
@JsonCreator
, JsonTypeInfo.As.EXTERNAL_PROPERTY
@JsonCreator
, @JsonAnySetter
, JsonTypeInfo.As.EXTERNAL_PROPERTY
Found one problem, fixed, but looks like there are multiple flawed code paths. |
I'm using Jackson for a while in simply way. I've just tried some more difficult tricks and I found a strange behaviour.
When I've combined JsonCreator annotation with a JsonTypeInfo.As.EXTERNAL_PROPERTY resolver, then the result is not the same than if I had not put the @JsonCreator.
My example is simple : I want to deserialize this String :
My classes are
When I launch the the two deserialization, I have the next results
When I've got the sources and I've tried to debug the unexpected MyJson2 result, I've lost myself in BeanDeserializer.deserializeUsingPropertyBasedWithExternalTypeId. The Json datas seem to be put in TokenBuffer which doesn't seem used.
I attached a fully executed Java File with my test classes.
TestDeserialisation.zip
Thanks for your attention
The text was updated successfully, but these errors were encountered: