swagger-api / swagger-api/swagger-codegen
Getting issue while generating java POJOs for ENUMs from swagger json
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Description
Getting issue while generating java POJOs for ENUMs from swagger json
Swagger-codegen version
2.2.3
Swagger declaration file content or url
"test_property": {
"type": "string",
"description": "Indicates the primary journey type for the application.",
"enum": [
"TEST_ONE",
"TEST_TWO",
"TEST_THREE",
]
},
generated POJO generating it as
ONE("TEST_ONE"),
TWO("TEST_TWO"),
THREE("TEST_THREE"),
ideally it should be generated it as
TEST_ONE("TEST_ONE"),
TEST_TWO("TEST_TWO"),
TEST_THREE("TEST_THREE"),
Command line used for generation
java
Steps to reproduce
generate with java
Related issues/PRs
Suggest a fix/enhancement
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing issue 7247 with swagger-codegen 2.2.3, the supplied Swagger enum property, and the Java generator. Trace the Java POJO enum generation path and verify that the generated constants preserve TEST_ONE, TEST_TWO, and TEST_THREE rather than dropping their prefixes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100