OpenAPITools / OpenAPITools/openapi-generator

[REQ] Option to generate only the models/controllers

Open
#20,538 4 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Enhancement: Feature
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.

The generators can only generate complete projects with models and controllers. However, I would like to use the generator as part of the normal build process to create generated files of the models and controllers, allowing me to enforce an API-first approach to changes.

Describe the solution you'd like

I want to exclude parts of the generated files so that it can only create the model and controller files. As changes to the Open API spec are made, new models and controllers can be generated, either as part of the build or as checked in.

Describe alternatives you've considered

Manually generate an entire project each time a change to the OpenAPI spec is made, and then selectively move the model and controller files into the destination project where they are used. The problem is that this is very error-prone.

Another approach is to use only a "code-first" approach to designing our API, generating the OpenAPI spec from the code and avoiding using the open API generators altogether.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no files, tests, or generator entry point. Start by locating the generator configuration that controls which artifacts are emitted; done means a tested option can generate only model and controller files from an OpenAPI specification without the other project files.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, openapi
Domain
api, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.