swagger-api / swagger-api/swagger-codegen

[Java] generateApiTests=false not working

Open
#8,781 7 comments 10 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Description

swagger-codegen-maven-plugin ignore the generateApiTests=false option

after mvn install test package present in generated sources and contains tests for api

plugin section in pom

<plugin>
                <groupId>io.swagger.codegen.v3</groupId>
                <artifactId>swagger-codegen-maven-plugin</artifactId>
                <version>3.0.0</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                        <configuration>
                            <inputSpec>${project.basedir}/src/main/resources/api/api.yaml</inputSpec>
                            <language>java</language>
                            <library>resttemplate</library>
                            <output>${project.build.directory}/generated-sources/openapi</output>
                            <apiPackage>org.openapitools.api</apiPackage>
                            <modelPackage>org.openapitools.model</modelPackage>
                            <invokerPackage>org.openapitools.invoker</invokerPackage>
                            <generateApiTests>false</generateApiTests>
                            <generateApiDocumentation>false</generateApiDocumentation>
                            <generateModelTests>false</generateModelTests>
                            <generateModelDocumentation>false</generateModelDocumentation>
                            <configOptions>
                                <dateLibrary>java8-localdatetime</dateLibrary>
                            </configOptions>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
Swagger-codegen version

3.0.0

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 by reproducing the Maven plugin's generate goal with the configuration shown, especially generateApiTests=false, and inspect the Java generator's handling of that option. Done means the generated sources contain no API test classes while the other configured generation options still behave as expected.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.