swagger-api / swagger-api/swagger-codegen
[Spring] only the last one will be generated in multiple inputSpec
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
I am using the following pom configuration to generate Controllers:
<plugin>
<groupId>io.swagger</groupId>
<artifactId>swagger-codegen-maven-plugin</artifactId>
<version>2.3.1</version>
<executions>
<execution>
<id>first-service-api</id>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<inputSpec>${project.basedir}/src/main/resources/api/administration.yaml</inputSpec>
<language>spring</language>
<configOptions>
<sourceFolder>src/gen/java/main</sourceFolder>
</configOptions>
<apiPackage>${default.package}.controller</apiPackage>
<modelPackage>${default.package}.model</modelPackage>
<generateSupportingFiles>false</generateSupportingFiles>
<skip>false</skip>
</configuration>
</execution>
<execution>
<id>second-service-api</id>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<inputSpec>${project.basedir}/src/main/resources/api/receiver.yaml</inputSpec>
<language>spring</language>
<configOptions>
<sourceFolder>src/gen/java/main</sourceFolder>
</configOptions>
<apiPackage>${default.package}.controller</apiPackage>
<modelPackage>${default.package}.model</modelPackage>
<generateSupportingFiles>false</generateSupportingFiles>
<skip>false</skip>
</configuration>
</execution>
</executions>
</plugin>
I use eclipse as my IDE, and trigger the generation via 'run as' --> 'maven generate-sources'.
I can only found one controller in target folder, which generated from the second 'execution'.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue with the shown Maven configuration, using administration.yaml and receiver.yaml as the two input specifications, then run Maven generate-sources and inspect the target folder. Trace why only the second execution's controller is present; done means both executions generate their controllers without overwriting or suppressing the first.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- spring
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100