-
-
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
JsonDeserialize(contentAs=...) broken with raw collections #2553
Comments
Interesting... thank you for reporting this, I think it should work as expected so need to see what causes the issue. |
Ok, yes, content type is lost within |
Found an easy fix: changing order of checks to first handle collections, then skip non-generic types seems to work, at least for Map/Collection use cases. |
@cowtowncoder, I'm hitting same issue but don't understand your solution, maybe because I'm new to jackson. Can you be more explicit or provide a code sample? |
@eduizquierdo There is a fix in Jackson 2.10.2 that should handle the original case. 2.10.2 was just relesed and is available for upgrade. |
JsonDeserialize(contentAs=...) doesn't seem to be honored if used with raw collections.
In the following example I would expect that the items field would be deserialized as the MyItem class but instead comes out as a
java.util.LinkedHashMap
. Adjusting the following example fromList
toList<Object>
causes things to work as expected. (I tried it in 2.9.10 and 2.10.1)I initially encountered this while doing some dynamic class creation via a
refineDeserializationType
method in a customAnnotationIntrospector
which caused the type from the subclass to be lost.The text was updated successfully, but these errors were encountered: