Cannot use both JsonCreator.Mode.DELEGATING
and JsonCreator.Mode.PROPERTIES
static creator factory methods for Enums
#3566
Labels
enum
Related to handling of Enum values
Describe the bug
When Enum has two factory methods, one with
JsonCreator.Mode.DELEGATING
and the other withJsonCreator.Mode.PROPERTIES
, only the latter works. Deserialization that is supposed to target the DELEGATING one fails withcom.fasterxml.jackson.databind.exc.MismatchedInputException
.Note that the same setup for a POJO works just fine.
Version information
2.13.3
To Reproduce
The
testClass
passes, buttestEnum
fails withAlso, you can remove the PROPERTIES factory method, and the DELEGATING method would work.
The text was updated successfully, but these errors were encountered: