Skip to content
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

Jackson @JsonFormat doesn't support Enum type #4506

Open
JinSeokO opened this issue Nov 2, 2023 · 0 comments
Open

Jackson @JsonFormat doesn't support Enum type #4506

JinSeokO opened this issue Nov 2, 2023 · 0 comments

Comments

@JinSeokO
Copy link

JinSeokO commented Nov 2, 2023

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"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant