-
Notifications
You must be signed in to change notification settings - Fork 6k
Closed
Labels
Milestone
Description
Description
In the CXF generator the basePath gets ignored since #4068 and all paths changed from 'host/basePath/operationPath' to 'host/operationPath'.
Swagger-codegen version
2.2.2-SNAPSHOT
Swagger declaration file content or url
swagger: '2.0'
info:
version: 1.0.0
title: missing basePath example
host: example.com
basePath: /exa
schemes:
- http
consumes:
- application/json
produces:
- application/json
paths:
/mple:
get:
responses:
200:
description: Examplegenerates
...
@Path("/")
@Api(value = "/", description = "")
public interface DefaultApi {
@GET
@Path("/mple")
@Consumes({ "application/json" })
@Produces({ "application/json" })
@ApiOperation(value = "", tags={ })
public void mpleGet();
}instead of
...
@Path("/exa")
...Command line used for generation
java -jar swagger-codegen-cli-2.2.2-SNAPSHOT.jar generate -i schema.json -l jaxrs-cxf
Steps to reproduce
Use a basePath in your swagger spec and generate the CXF server code.
Related issues
Pull #4068
Suggest a Fix
Change
@Path("/")in
swagger-codegen/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/api.mustache
Line 21 in 14bca6c
| @Path("/") |
back to
@Path("{{contextPath}}")