Skip to content

[swagger-codegen-maven-plugin:2.2.1] Use both java8 date-time and model name suffix will result wrong date-time class name #3678

@fayndee

Description

@fayndee
Description

When using swagger-codegen-maven-plugin:2.2.1, if both dateLibrary=java8 and modelNameSuffix=Resource options are specified, it will accidentally generate fields with type for example: OffsetDateTimeResource.

Swagger-codegen version

2.2.1

Command line used for generation

Maven config:

<plugin>
    <groupId>io.swagger</groupId>
    <artifactId>swagger-codegen-maven-plugin</artifactId>
    <version>2.2.1</version>
    <executions>
        <execution>
            <goals>
                <goal>generate</goal>
            </goals>
            <configuration>
                <inputSpec>http://petstore.swagger.io/v2/swagger.json</inputSpec>
                <language>java</language>
                <library>retrofit2</library>
                <configOptions>
                    <dateLibrary>java8</dateLibrary>
                </configOptions>
                <modelNameSuffix>Resource</modelNameSuffix>
            </configuration>
        </execution>
    </executions>
</plugin>
Steps to reproduce

Run mvn package.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions