You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I searched in the issues and found nothing similar.
I have confirmed that the same problem is not reproduced if I exclude the KotlinModule.
I searched in the issues of databind and other modules used and found nothing similar.
I have confirmed that the problem does not reproduce in Java and only occurs when using Kotlin and KotlinModule.
Describe the bug
After upgrading from v2.17.2 to v2.18.1, we cannot parse sealed hierarchies annotated with @JsonTypeInfo anymore. The code in the example works in v2.17.2, but doesn't work in later versions and produces the following exception:
com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot construct instance of ChildClass (although at least one Creator exists): cannot deserialize from Object value (no delegate- or property-based Creator)
One suggestion: this might be due to change in detection of "Creator" style (Delegating vs Property), and not polymorphic handling or sealed classes.
One way to fix this is so is by adding
@JsonCreator(mode = JsonCreator.Mode.DELEGATING)
to constructor (I forget how that is done with Kotlin -- @k163377 can help).
The change, if my hunch is correct, is because of how ambiguity of 1-property types is resolved -- this is heuristic and fundamentally ambiguous. But formerly (2.17) it seems that the case was deemed as Delegating (not recognizing text as property), but with property introspection rewrite in 2.18, as Property-based.
Search before asking
Describe the bug
After upgrading from v2.17.2 to v2.18.1, we cannot parse sealed hierarchies annotated with
@JsonTypeInfo
anymore. The code in the example works in v2.17.2, but doesn't work in later versions and produces the following exception:com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot construct instance of
ChildClass
(although at least one Creator exists): cannot deserialize from Object value (no delegate- or property-based Creator)To Reproduce
Expected behavior
Prints
true
.Versions
Kotlin:
Jackson-module-kotlin: 2.18.1
Jackson-databind: 2.18.1
Additional context
No response
The text was updated successfully, but these errors were encountered: