swagger-api / swagger-api/swagger-codegen
[Jaxrs] Compile error after generate jaxrs-cxf-client because of two InnerEnums
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Description
I generated a jaxrs-cxf-client out of a Swagger JSON file. The JSON file contains two enums and after the generation both enums have the same name (InnerEnum) in the generated Java class which causes compile errors.
Swagger-codegen version
I used the current master branch (from July 13 2018).
Swagger declaration file content or url
I used the Swagger JSON file https://gist.github.com/andre-becker/e06aa56af6f641b18808cecac7abe190.
Command line used for generation
I used the command line:
java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate -i https://gist.githubusercontent.com/andre-becker/e06aa56af6f641b18808cecac7abe190/raw/9900b435032b398bcda2ddd6451989330b5c8d0e/gistfile1.txt -l jaxrs-cxf-client
Steps to reproduce
- Clone swagger-codegen and build it:
git clone https://github.com/swagger-api/swagger-codegen
cd swagger-codegen
mvn clean package
- Generate the jaxrs-cxf-client using my JSON file (use the given link or copy/paste it to a local file from the link above):
java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate -i https://gist.githubusercontent.com/andre-becker/e06aa56af6f641b18808cecac7abe190/raw/9900b435032b398bcda2ddd6451989330b5c8d0e/gistfile1.txt -l jaxrs-cxf-client
- Open the generated Java class
Swaggerobject.java.
There are compile errors in the generated class (e.g. there are two enums with the name InnerEnum).
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
Reproduce the issue with the linked Swagger JSON, the jaxrs-cxf-client generator, and the provided Maven build and CLI command. Inspect the generated Swaggerobject.java and trace how the two enum declarations receive the same InnerEnum name. Done means the generated Java class uses distinct enum names and compiles without errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100