-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
@JsonCreator not working on a factory with multiple arguments for a enum type #929
Comments
I can confirm this. Support for multi-argument creators does not yet exist; exception is thrown with "Unsuitable method decorated with @JsonCreator (for Enum type )". |
+1 for this issue. I prefer serialization either as a simple value (using @JsonValue), or as "an Object" instead of standard enum values. By doing so you are giving the consumer side the chance to use regular (non-enum) classes. Having to use enums on "both sides" introduces undesirable tight coupling. |
Using a factory method having multiple arguments annotated with @JsonCreator works normally when the factory is for a class type, but fails if the factory is for an enum type.
jackson-databind v 2.5.1
jackson-annotations v 2.5.0
e.g. code
both MyClass and MyEnum has a method like
The text was updated successfully, but these errors were encountered: