-
-
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
Polymorphic deserialization doesn't support multiple levels of inheritance. #1188
Comments
I can't say for sure without spending time in digging through this, but it is safe to say that combination of generics with polymorphic types may well lead to problems, and that I would recommend caution in use. Other than that what I'd need is a full reproduction, since how deserialization is used matters a lot: for example, root value handling with generics is often more problematic than that of types where root value is not parameterized, but some of properties are generic. |
Sure. I'll try to carve out time for to give you a good repro. I need some time to narrow down a minimal case. |
@clin88 much appreciated if you are able to do that. |
One thing on example shown: use of different I guess another way to put this is that no chaining is used with polymorphic type handing, so it is not possible to have one phase to resolve into intermediate type, another into actual type (or another intermediate type). Custom handler would need to be indicated at base type that is used as deserialization base (nominal type). |
Multiple levels not supported, no plans to support out of the box, even with Jackson 3.x. |
Say I have a
Where ConstraintRule is an abstract class that looks like:
and data that embeds a CollectionRule (one of the polymorphic types of the abstract ConstraintRule) inside of another Rule type.
Results in this error from AbstractDeserializer:
I think this is because TypeDeserializerBase doesn't try to find a root value deserializer in _findDeserializer:
But I don't understand Jackson's architecture to really say for sure.
Is this intended behavior or a bug?
The text was updated successfully, but these errors were encountered: