swagger-api / swagger-api/swagger-codegen
[Go] Ability to remove class prefix from methods?
Open
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Description
When generating Go code for swagger openAPI 3.0, the Go methods contain the class names as a prefix.
Is there a way to remove those? e.g.
func (a *ProgramUpdatesApiService) ProgramUpdatesDelete() { ... }
vs
func (a *ProgramUpdatesApiService) Delete() { ... }
Swagger-codegen version
3.0.36
Command line used for generation
swagger-codegen generate -i foo.com/swagger.json -l go -o subdirectory/ --model-package model --api-package api --invoker-package generated
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 Go generation invoked by swagger-codegen generate and compare the generated ProgramUpdatesApiService methods with the naming examples in the issue. Establish how the requested prefix removal should be exposed; done when the generator can produce Delete() instead of ProgramUpdatesDelete() without changing the existing default.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, openapi
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 32/100