swagger-inflector icon indicating copy to clipboard operation
swagger-inflector copied to clipboard

Always regenerating controller

Open martinduris opened this issue 9 years ago • 1 comments

Hi,

i would like to use Swagger-Inflector to generate from yaml file server code (interfaces and controller).

After i call code generation (maven, goal install) - code is generated. But when i do some implementation, code is always regenerated and my work is gone.

Here is my pom.xml

<groupId>com.swagger</groupId>
<artifactId>main</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>

<modules>
    <module>generated-sources</module>
</modules>

<build>
    <plugins>
        <plugin>
            <groupId>io.swagger</groupId>
            <artifactId>swagger-codegen-maven-plugin</artifactId>
            <version>2.1.5</version>
            <executions>
                <execution>
                    <goals>
                        <goal>generate</goal>
                    </goals>
                    <configuration>
                        <inputSpec>src/main/resources/api.yaml</inputSpec>
                        <language>inflector</language>
                        <output>generated-sources/</output>
                        <configOptions>
                            <sourceFolder>src/gen</sourceFolder>
                        </configOptions>
                    </configuration>
                </execution>
            </executions>
        </plugin>
    </plugins>

</build>

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>io.swagger</groupId>
            <artifactId>swagger-inflector</artifactId>
            <version>1.0.6</version>
        </dependency>
    </dependencies>
</dependencyManagement>

All code is generated into maven module generated-sources. According to documentation swagger-inflector should look for existing controller. Do i need to explictly configure something (add to claspath etc. ...)

Thank you very much

martinduris avatar Jun 14 '16 19:06 martinduris

Can you please test using 2.1.6 of the maven plugin?

fehguy avatar Jun 15 '16 17:06 fehguy