Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ghost opened this issue Jan 9, 2016 · 4 comments
Closed

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

ghost opened this issue Jan 9, 2016 · 4 comments

Comments

@ghost
Copy link

ghost commented Jan 9, 2016

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.

@webron
Copy link
Contributor

webron commented Jan 11, 2016

The spec itself doesn't support matrix params and swagger-core follows the spec. Please see OAI/OpenAPI-Specification#69.

@webron webron closed this as completed Jan 11, 2016
@jontejj
Copy link

jontejj commented Aug 10, 2017

Is it time to open this up again as it's now defined in version 3.0 of the Open API spec? https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#parameterObject

@webron
Copy link
Contributor

webron commented Aug 10, 2017

Nope. It would be implemented as part of the OAS3 implementation.

@jontejj
Copy link

jontejj commented Aug 11, 2017

I see that swagger UI is supporting version 3 of the spec? But I don't see any output in my service.json generated by io.swagger.jaxrs.listing.ApiListingResource for my @MatrixParam annotated parameters

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants