Skip to content

[JAXRS-CXF] basePath ignored since #4068 #4569

@markus-wa

Description

@markus-wa
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:  Example

generates

...
@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


back to

@Path("{{contextPath}}")

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions