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
Is there any reason why something like this would not be supported:
public enum DeviceType {
@JsonPropertyValue("DeviceTypeMobile")
DEVICE_TYPE_MOBILE,
@JsonPropertyValue("DeviceTypeDesktop")
DEVICE_TYPE_DESKTOP
}
and now when serialising/deserialising the values in the annotations would be used, but in Java you would use the more Java-like enum names.
Is there a technical issue preventing this from being supported or has no one simply addressed this yet?
I am aware of the more complicated, manual, way of achieving this behaviour using @JsonValue and @JsonCreator with custom from/to methods, but it seems this is enough of a common problem (at least for people that want neatly-named enum values) that the above, elegant, solution would be nice to have.
Would be interested in implementing this if need be
The text was updated successfully, but these errors were encountered:
Right, #677 is the original issue I think, so additional comments may be added there. And we should be able to just use @JsonProperty to reduce explosion in number of annotations declared.
Is there any reason why something like this would not be supported:
and now when serialising/deserialising the values in the annotations would be used, but in Java you would use the more Java-like enum names.
Is there a technical issue preventing this from being supported or has no one simply addressed this yet?
I am aware of the more complicated, manual, way of achieving this behaviour using @JsonValue and @JsonCreator with custom from/to methods, but it seems this is enough of a common problem (at least for people that want neatly-named enum values) that the above, elegant, solution would be nice to have.
Would be interested in implementing this if need be
The text was updated successfully, but these errors were encountered: