Skip to content

Generate failed: Cannot invoke "java.util.Map.size()" because "map" is null #109

@dorus-private

Description

@dorus-private

Describe the bug
After configured the plugin in my pom.xml, by invoking "mvn clean install" the build is falling with the following error:

[ERROR] Failed to execute goal io.openapitools.swagger:swagger-maven-plugin:2.1.5:generate (default) on project IBANValidator: Execution default of goal io.openapitools.swagger:swagger-maven-plugin:2.1.5:generate failed: Cannot invoke "java.util.Map.size()" because "map" is null

To Reproduce
I am using java 17 and the following plugin configuration:

            <plugin>
                <groupId>io.openapitools.swagger</groupId>
                <artifactId>swagger-maven-plugin</artifactId>
                <version>${swagger.maven.plugin}</version>
                <configuration>
                    <resourcePackages>
                        <resourcePackage>com.mypackage.restcontroller</resourcePackage>
                    </resourcePackages>
                    <outputDirectory>${basedir}/target/</outputDirectory>
                    <outputFilename>swagger.out</outputFilename>
                    <outputFormats>JSON,YAML</outputFormats>
                    <prettyPrint>true</prettyPrint>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

swagger.maven.plugin has value 2.1.5, the same is happening for version 2.1.6.

Expected behavior
I expected to have 2 generated files.

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions