swagger-api / swagger-api/swagger-codegen
[JAVA]Change to method names for codegen for Spring-Boot.
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Description
Looks like the naming convention for methods has changed. Previously (about a month ago) when I would codegen, the methods on the controller matched the resource path defined in the API (ex /myMethod would result in a method name of myMethod(). Now the method names are appended with the HTTP verb so /myMethod is generated as myMethodPost(). So this obviously will break our CI/CD flow if we ever have to go back and codegen from SwaggerHub.
Is this a bug or an intended change?
Swagger-codegen version
This is the codegen version used in SwaggerHub. Using openapi v3.
Swagger declaration file content or url
Command line used for generation
Steps to reproduce
Related issues/PRs
Suggest a fix/enhancement
Either
- make it optional to append the verb to the method name
- generate the method name from some specific declaration in the yaml (ex tag)
- revert back to the previous generation naming convention.
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 Spring-Boot Java generator and reproduce the reported change from a minimal OpenAPI v3 definition, comparing a path such as /myMethod with the generated controller method name. The issue provides no declaration, command, file, or test; done would require establishing the intended naming convention and adding coverage for the selected behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring-boot
- Domain
- backend-api-design, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 28/100