-
Notifications
You must be signed in to change notification settings - Fork 175
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
Cannot Construct Subtype of Sealed Class #844
Comments
One suggestion: this might be due to change in detection of "Creator" style (Delegating vs Property), and not polymorphic handling or sealed classes.
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 |
Very likely fixed by |
I added a regression test based on the code submitted by @skvariljan and verified that it has been fixed. |
This is great news, thank you. |
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: