swagger-api / swagger-api/swagger-codegen
Issue while generating Bean if object contains _id and id both
Open
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Description
{
"_id": "string",
"id": "string"
}
In bean getId() method will generate twice which creates issue.
Swagger-codegen version
swagger-codegen-cli-3.0.18.jar
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 swagger-codegen-cli-3.0.18.jar using the JSON object shown in the report. Inspect the generated bean and its getId() method; done means the object containing both _id and id no longer produces a duplicate accessor or generation error.
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