OpenAPITools / OpenAPITools/openapi-generator
[REQ] Feign Configuration should be named after the classname
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Bug Report Checklist
At the moment each generated feign client has the following configuration:
Description
@Configuration
@EnableConfigurationProperties
public class ClientConfiguration {
This is a grave problem as it only allows for one feign client per spring application: if 2 or more are present the application will crash because it will find 2 identical bean in 2 different packages ("ClientConfiguration" bean, indeed).
openapi-generator version
Present in all versions
Suggest a fix
Simply make "className" available in the clientConfiguration.mustache (dunno why it is not present at the moment...) and alter the template by doing:
@Configuration
@EnableConfigurationProperties
public class {{classname}}ClientConfiguration {
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 generated Feign client's clientConfiguration.mustache template and inspect how classname is exposed to templates. Update the configuration class naming so multiple generated clients do not produce identical ClientConfiguration beans, then verify the generated Java output for distinct client class names.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100