Skip to content

MatrixParam mapping not correct (swagger 2.0 ,v1.5.6) #1597

Closed
@ghost

Description

When use swagger 2.0 V1.5.6 (use swagger 1.0 v1.3.8 the result is correct) , MatrixParam mapping not correct , in swagger.json ,MatrixParam should be mapped into a matrix actually mapped into a body.

For example ,I define an interface like below:

@GET
    @Path("/{id}")
    @Produces({ MediaType.APPLICATION_JSON })
    @ApiOperation(value = " ")
    public void getByid(@PathParam("id") int tagsId,
            @ApiParam(value = "serviceName") @DefaultValue("run_time") @MatrixParam("sortField") String sortField) {

    }

the swagger 2.0 mapping result is :

{
  "get": {
    "tags": [
      "TagsServer"
    ],
    "summary": " ",
    "description": "",
    "operationId": "getByid",
    "produces": [
      "application/json"
    ],
    "parameters": [
      {
        "name": "id",
        "in": "path",
        "required": true,
        "type": "integer",
        "format": "int32"
      },
      {
        "in": "body",
        "name": "body",
        "description": "serviceName",
        "required": false,
        "schema": {
          "type": "string",
          "default": "run_time"
        }
      }
    ],
    "responses": {
      "default": {
        "description": "successful operation"
      }
    }
  }
}

MatrixParam's name and type not correct.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions