OpenAPITools / OpenAPITools/openapi-generator

[REQ] Conveniently only generate client classes

Open
#5,800 6 comments 19 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

I often generate client code from a spec file with the maven plugin, like this:

        <configuration>
          <inputSpec>src/main/oas/oas.yaml</inputSpec>

          <generatorName>java</generatorName>
          <library>native</library>

          <configOptions>
            <dateLibrary>java8</dateLibrary>
          </configOptions>

          <apiPackage>${project.groupId}.client</apiPackage>
          <modelPackage>${project.groupId}.client</modelPackage>
          <invokerPackage>${project.groupId}.client</invokerPackage>

          <generateApiTests>false</generateApiTests>
          <generateModelTests>false</generateModelTests>
          <generateModelDocumentation>false</generateModelDocumentation>
          <generateApiDocumentation>false</generateApiDocumentation>
          <supportingFilesToGenerate>
            ApiException.java,Pair.java,ApiClient.java
          </supportingFilesToGenerate>
        </configuration>

It would be nice to have a single config property that disables the generation of tests, documentation and also all the supporting files that are not needed for compilation.

It would also be nice to be able to specify the package name only once if you want everything in the same package. packageName does not do this.

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

Start with the Maven plugin configuration and the existing generateApiTests, generateModelTests, generateModelDocumentation, generateApiDocumentation, supportingFilesToGenerate, and package settings shown in the issue. Trace how these options are applied, then define and test the requested consolidated generation and package-name behavior against the Java client example.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.