Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

enums print as strings #1765

Closed
fehguy opened this issue Apr 19, 2016 · 0 comments
Closed

enums print as strings #1765

fehguy opened this issue Apr 19, 2016 · 0 comments
Assignees

Comments

@fehguy
Copy link
Contributor

fehguy commented Apr 19, 2016

The code below shows that the numeric enums are converted to strings when being written as YAML:

        String yaml =
            "swagger: '2.0'\n" +
            "paths:\n" +
            "  /test:\n" +
            "    get:\n" +
            "      parameters:\n" +
            "      - name: \"days\"\n" +
            "        in: \"path\"\n" +
            "        required: true\n" +
            "        type: \"integer\"\n" +
            "        format: \"int32\"\n" +
            "        enum:\n" +
            "        - 1\n" +
            "        - 2\n" +
            "        - 3\n" +
            "        - 4\n" +
            "        - 5\n" +
            "    responses:\n" +
            "      default:\n" +
            "        description: great";

        Swagger swagger = Yaml.mapper().readValue(yaml, Swagger.class);
        Yaml.prettyPrint(swagger);
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants