-
-
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
ObjectMapper.readTree(…)
causes InvalidTypeIdException
#3506
Comments
As a general rule, I would advise strongly against ever using Now... whether usage above is valid or invalid I can't say off-hand. As the general rule, if polymorphic handling (esp. default typing is enabled), conversions are off the table: what is written must really be written with same nominal base type. And since For time being I would suggest having different I am not sure whether handling like above can be supported in near future. Also: as to
in which case whatever value is used will use polymorphic typing. |
Thanks a lot for the insights. In our case, we're providing a generic serialization utility within a framework to handle all Java classes for an application, including Kotlin-compiled classes. Trying to avoid ˋEVERYTHINGˋ ended up in a lot of custom code that didn't look to us as if it was intended that way. We can give it another spin. For the time being, having another ObjectMapper instance is what we went for. I think we can close this ticket as the reasoning why things work like they do makes sense. |
@mp911de Instead of EVERYTHING, it would probably make sense to have a custom handler to determine the rules -- out-of-the-box options may not be ideal for your use case. I forget exactly which handler class to reimplement, but I hope looking at config methods for Also: you probably tried this already but |
Describe the bug
Not sure this is a reincarnation of #793. Attempting to read a JSON into
JsonNode
fails when theObjectMapper
is initialized with default typing.Version information
2.13.2
To Reproduce
Expected behavior
readTree(…)
should allow reading JSON into a tree to bypass JSON to object mapping.Exception
The text was updated successfully, but these errors were encountered: