swagger-api / swagger-api/swagger-codegen

[MAVEN] swagger-codegen-maven-plugin:2.2.3 generate goal execution fails

Open
#6,590 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Issue: Bug Swagger Codegen Maven Plugin
Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Description

I upgraded plugin from v2.2.2 to v2.2.3 to specifically test the allOf and anyOf handling functionality, but generate goal just doesn't work anymore.

Swagger-codegen version

swagger-codegen-maven-plugin version -
v2.2.3

Swagger declaration file content or url

https://github.com/swagger-api/swagger-codegen/blob/master/modules/swagger-codegen-maven-plugin/examples/swagger.yaml

Command line used for generation

mvn io.swagger:swagger-codegen-maven-plugin:2.2.3:generate

Steps to reproduce
  1. please install maven3.3.3 on your workspace (or, use maven 3.3.x wrapper in your project)
  2. Please create a maven project with following plugin configuration for swagger-codegen-maven-plugin -
<project>
...
<build>
               <plugin>
                <groupId>io.swagger</groupId>
                <artifactId>swagger-codegen-maven-plugin</artifactId>
                <version>2.2.3</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                        <configuration>
                            <inputSpec>swagger.yaml</inputSpec>
                            <output>${project.build.directory}/generated-sources</output>
                            <language>java</language>
                            <configOptions>
                                <dateLibrary>java8</dateLibrary>
                            </configOptions>
                            <environmentVariables>
                                <models/>
                            </environmentVariables>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
</build>
</project>
  1. download the swagger.yaml from github url provided in previous section and save it right next to pom.xml.

  2. Run -
    mvn io.swagger:swagger-codegen-maven-plugin:2.2.3:generate

Related issues/PRs

This is the closest I came to finding something on this -
https://github.com/swagger-api/swagger-codegen/issues/6362

Suggest a fix/enhancement

I tried going through the changes between 2.2.2 and 2.2.3, but too many changes to figure maven-plugin related changes -
https://github.com/swagger-api/swagger-codegen/compare/v2.2.2...v2.2.3

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

Reproduce the failure with the swagger-codegen-maven-plugin configuration in the issue, Maven 3.3.x, and modules/swagger-codegen-maven-plugin/examples/swagger.yaml. Compare the v2.2.2 and v2.2.3 changes, including related issue #6362, then identify the plugin change responsible; done means the v2.2.3 generate goal completes for the supplied project.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.