Skip to content

InvalidTypeIdException Cannot deduce unique subtype #3577

@jmjava

Description

@jmjava

I am attempting to use deduction with 2.13.3

I have a set of classes that have a largish set of properties (over 10) and sometimes only differ by one or two fields

Some of the classes are able to deserialize correctly but others get this exception

com.fasterxml.jackson.databind.exc.InvalidTypeIdException: Could not resolve subtype of [simple type, class xxxxx]: Cannot deduce unique subtype of oxxxxxxx (3 candidates match)

If I step debug the code I can see this before the error is thrown. It appears there is something called subTypeFingerprints that shows this

Screen Shot 2022-08-19 at 7 12 52 PM

What is interesting is that the error says 3 candidates match and as you can see from the picture above... there are 3 candidates that match up to the value of 11...

is there a limit on the number of comparisons that are made? As you can see the fingerprints seem to indicate that a deduction should be possible, yet I am getting this error

-john

Metadata

Metadata

Assignees

No one assigned

    Labels

    polymorphic-deductionIssues related to "Id.DEDUCTION" mode of `@JsonTypeInfo`

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions