Skip to content

Annotation support should allow @JsonValue/JsonCreator on enum #91

@ashleyfrieze

Description

@ashleyfrieze

As suggested in https://cowtowncoder.medium.com/using-jackson-annotations-with-jackson-jr-51087850b95e this would be an important addition to jackson jr.

Our context is that we're using jackson jr in an AWS Lambda in order to reduce code size. We have an open api module which has code-generated Java classes/enums, and we have the following generated code:

public enum VehicleType {
    CAR("Car"),
    MOTORCYCLE("Motorcycle"),
    ...


    @JsonValue
    public String toString() {
        return String.valueOf(this.value);
    }

    @JsonCreator
    public static VehicleType fromValue(String value) {

As things stand at the moment, there's no way we can deserialize Car into VehicleType.CAR

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions