Skip to content

Jackson @JsonFormat doesn't support Enum type #4506

Description

@JinSeokO

Same Issue on: #3691

ModelResolve doesn't support @jsonformat

@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum User {
    FOO(1, "Foo"),
    BAR(2, "Bar");

    User(int id, String name) {
        this.id = id;
        this.name = name;
    }

   @JsonProperty("id")
    public int id;

    @JsonProperty("name")
    public String name;
}

expect

"User" : {
    "properties" : {
        "id" : {
            "format" : "int32",
            "type" : "integer"
        },
        "name" : {
            "type" : "string"
        }
    },
    "type" : "object"
}

Serialize

"user" : {
    "enum" : [ "FOO", "BAR" ],
    "type" : "string"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions