Open Xfel opened 3 weeks ago
@drekbour WDYT? Although in general it is difficult to determined viability of deserializing into given type (Jackson really knows by trying to figure it out), being abstract
would be reliable "no can do" signal indeed.
Sounds sensible to me
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.