I am running a java/resttemplate client generation with the following maven plugin configuration

        <plugin>
            <groupId>io.swagger.codegen.v3</groupId>
            <artifactId>swagger-codegen-maven-plugin</artifactId>
            <version>3.0.8</version>
            <executions>
                <execution>
                    <id>api</id>
                    <phase>generate-sources</phase>
                    <goals>
                        <goal>generate</goal>
                    </goals>
                    <configuration>
                        <inputSpec>${maven.multiModuleProjectDirectory}/api/target/generated/swagger-api-spec/swagger.json</inputSpec>  
                        <language>java</language>
                        <library>resttemplate</library>
                        <modelPackage>com.company.springapi.model</modelPackage>
                        <apiPackage>com.company.springapi.api</apiPackage>
                        <invokerPackage>com.company.springapi.invoker</invokerPackage>
                        <generateSupportingFiles>true</generateSupportingFiles>
                        <supportingFilesToGenerate>
                            ApiClient.java,OAuth.java,ApiKeyAuth.java,Authentication.java,HttpBasicAuth.java,RFC3339DateFormat.java
                        </supportingFilesToGenerate>
                        <configOptions>
                            <java8>true</java8>
                            <dateLibrary>java8</dateLibrary>
                            <interfaceOnly>true</interfaceOnly>
                            <groupId>com.company.provider</groupId>
                            <artifactId>${project.artifactId}</artifactId>
                            <artifactVersion>${project.version}</artifactVersion>
                        </configOptions>
                    </configuration>
                </execution>
            </executions>
        </plugin>

and it produces separate TagApi.java files for each tagged controller, e.g. Tag1Api.java, Tag2Api.java, Tag3Api.java... (plus ApiClient.java plus supporting files).


answer looks to be here: https://github.com/swagger-api/swagger-codegen/blob/05db33c135d5e8c8220a4b3771d79c40cd94bcd5/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultGenerator.java#L454

0 Answers