JsonTypeInfo.Id.DEDUCTION blocks signatures for non-instantiable classes #4708
Labels
2.19
Issues planned at 2.19 or later
polymorphic-deduction
Issues related to "Id.DEDUCTION" mode of `@JsonTypeInfo`
Search before asking
Describe the bug
I have a class hierarchy with multiple levels of abstract classes that I want to deserialize in DEDUCTION mode.
If I explicitly add only the leaf classes as subtypes it works fine.
However I'm using kotlin and sealed classes, and here the intermediate levels are also registered. These intermediate level classes do not have a JsonCreator and are sealed/abstract, so they cannot be instantiated. I would expect the AsDeductionTypeDeserializer to simply ignore these types.
However, it does not do so and instead complains that these abstract types have the same signature.
Version Information
2.17.2
Reproduction
Expected behavior
No response
Additional context
jackson-module-kotlin only scans for direct subclasses of sealed classes, recursion in the hierarchy is handled by the core logic. Therefor this seems like an issue for this project.
The text was updated successfully, but these errors were encountered: