OpenAPITools / OpenAPITools/openapi-generator
[REQ] [Spring] ApiFirst should generate apis and models
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Is your feature request related to a problem? Please describe.
I am trying to generate spring project with apiFirst = true. And I see it doesn't generate api and models, only delegates and home controller to serve openapi json and yaml files.
As I understand it is because of these lines:
https://github.com/OpenAPITools/openapi-generator/blob/c974c512ff590c797db9f3e93c079017d65d3dcd/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java#L411-L414
Describe the solution you'd like
I think if it is api-first solution apis and models should be generated from yaml.
Also plugin openapi-generator-maven-plugin already has controls which can be used for same control: generateApis, generateModels.
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 in modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java at lines 411-414, then compare the openapi-generator-maven-plugin controls generateApis and generateModels. The work is done when apiFirst generation produces APIs and models from the YAML instead of only delegates and the HomeController serving the OpenAPI files.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, openapi, spring
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100