swagger-api / swagger-api/swagger-codegen
[JAVA] Problem with properties that have "set" in their name
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Description
The API I'm trying to generate the client for, hat a class Card with a property "name" and a property "setName" (The name of the set it belongs to). From that, the generator generates duplicate methods: A method void setName(String name) for setting the name and a method Card setName(String setName) that sets the setName and returns this.
Is there any way to avoid this? I cannot change the API.
Swagger-codegen version
I used editor.swagger.io
Swagger declaration file content or url
https://github.com/jdharmon/scryfallapi/blob/master/swagger.yaml
Command line used for generation
The one editor.swagger.io uses
Steps to reproduce
- Use a YAML-File that has a class with the properties "name" and "setName"
- Generate a Java-client
- Try to build the client
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 with the linked swagger.yaml and reproduce the generation through editor.swagger.io using a Java client, following the listed steps. Compare the generated methods for the name and setName properties; done means the generated client no longer contains duplicate setName methods and builds successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100