Skip to content
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

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

Closed
cal101 opened this issue Sep 24, 2015 · 3 comments
Closed

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

cal101 opened this issue Sep 24, 2015 · 3 comments
Labels
Milestone

Comments

@cal101
Copy link

cal101 commented Sep 24, 2015

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

@dilipkrish
Copy link
Member

You're most likely using a feature were incubating. I think it should revert to regular behavior if you set in your docket

      .enableUrlTemplating(false);

@cal101
Copy link
Author

cal101 commented Sep 24, 2015

Just figured that seconds ago, you are absolutely right.
For whatever copy&paste reason I had ".enableUrlTemplating(true)" in the docket.
Thanks for the fast response!

@SenZh
Copy link

SenZh commented May 11, 2017

I had the same question.thanks!

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

No branches or pull requests

3 participants