Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Are query parameter templates for "path" entries valid? #986

@cal101

Description

@cal101

Here is a simplified use case using swagger annotations 1.5.3 with springfox 2.2.2:

@ApiOperation(value = "Echos value", notes = "Echos value", tags="Testing")
    @RequestMapping(method = RequestMethod.GET,
            value = "/hello",
            produces = { APPLICATION_HAL_JSON, MediaType.APPLICATION_JSON_VALUE }
       )
    String getXY(@ApiParam(name = "message", required = true)
                 @RequestParam(name = "page", required = true) String message) {
        return "Hello " + message;
    }

That generates

"/api/hello{?message}": {

    "get": 

This query params syntax "{?message}" is not supported by swagger ui 2.2.2.
From reading the swagger spec I got the impression, that only "path variables" are allowed, not "query param variables".
IMHO the path should read "/api/hello" in this case.

Opinions?

Cal

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions