Skip to content

[BUG] Migrating from openapi-generator-maven-plugin 4.3.1 to 5.0.1 breaks because of missing springfox dependency due to unused ApiIgnore import. #8916

Closed
@jbx1

Description

@jbx1
Description

Using an OpenAPI 3 definition, one needs to use Springdoc not springfox.

This used to work with openapi-generator-maven-plugin 4.3.1 with the springdoc-openapi-ui dependency included in the pom.xml.

However, upgrading to plugin version 5.0.1 suddenly expects springfox dependency and in the generated Api files there is this import import springfox.documentation.annotations.ApiIgnore; which breaks the build.

This import is actually not used, and after removing it manually it compiles successfully.

openapi-generator version

5.0.1 regression (used to work in 4.3.1)

Generation Details
    <plugin>
            <groupId>org.openapitools</groupId>
            <artifactId>openapi-generator-maven-plugin</artifactId>
            <version>5.0.1</version>
            <executions>

            <execution>
                <goals>
                    <goal>generate</goal>
                </goals>
                <id>api</id>
                <configuration>
                    <inputSpec>${basedir}/src/main/resources/api/api.yaml</inputSpec>
                    <generatorName>spring</generatorName>
                    <apiPackage>com.test.data.api</apiPackage>
                    <modelPackage>com.test.data.model</modelPackage>
                    <configOptions>
                        <java8>true</java8>
                        <dateLibrary>java8</dateLibrary>
                        <interfaceOnly>true</interfaceOnly>
                    </configOptions>
                </configuration>
            </execution>
            </executions>
            </plugin>
Steps to reproduce

Include the following dependencies in the Maven pom.xml file.

      <dependency>
            <groupId>io.swagger.parser.v3</groupId>
            <artifactId>swagger-parser</artifactId>
            <version>2.0.24</version>
        </dependency>


        <dependency>
            <groupId>org.springdoc</groupId>
            <artifactId>springdoc-openapi-ui</artifactId>
            <version>1.5.5</version>
        </dependency>

Generate any openapi 3.0.

Suggest a fix

Remove any reference to Springfox in the generated API files, especially if they are not even used.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions