@RequestMapping annotation is not generated in spring server code generation.
basePath is properly defined in swagger.yaml file.
Swagger codegen version :
swagger-codegen-maven-plugin: 2.2.1 and also tired with 2.2.2-SNAPSHOT
https://gist.github.com/tdhancii/1d0dde04413b6d98a76598a549a68985
Used Maven plugin to generate code
<plugin>
<groupId>io.swagger</groupId>
<artifactId>swagger-codegen-maven-plugin</artifactId>
<version>2.2.1</version>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<inputSpec>src/main/resources/swagger.yaml</inputSpec>
<apiPackage>co.test.swagger.api</apiPackage>
<modelPackage>co.test.swagger.model</modelPackage>
<language>spring</language>
<environmentVariables>
<models></models>
<apis></apis> <supportingFiles>HomeController.java,SwaggerDocumentationConfig.java</supportingFiles>
</environmentVariables>
</configuration>
</execution>
</executions>
</plugin>
just generate the code using maven plugin and check the DomainApi.java class. You will see that there is not path mapping annotation for basePath: v1 defined in the swagger spec
The context Path (e.g. v1, v2) should be set in application.properties, e.g. https://github.com/swagger-api/swagger-codegen/blob/master/samples/server/petstore/springboot/src/main/resources/application.properties
Thanks for the update
How can the context v1 or v2 (which can both be contained in the same Spring instance) be set in application.properties (which is common to all endpoints in the Spring instance) ?
And what if the same Spring instance handles other URLs than just the Swagger-managed API ?
Most helpful comment
How can the context v1 or v2 (which can both be contained in the same Spring instance) be set in application.properties (which is common to all endpoints in the Spring instance) ?
And what if the same Spring instance handles other URLs than just the Swagger-managed API ?