swagger-ui icon indicating copy to clipboard operation
swagger-ui copied to clipboard

Get service issue with PathVariable and RequestParam

Open PBondugula opened this issue 9 years ago • 3 comments

Hi team, I am trying swagger document by using JS files from https://github.com/swagger-api/swagger-ui/tree/master/dist. Version: v3.0.10

After loading in Swagger-UI, GET service is working fine if we have one path parameter. If we have multiple path parameters or combination of path and RequestParam, the CURL command is not generating properly.

getMyProduct(@PathVariable(value="prodid") String pid,@RequestParam(value="pname", defaultValue="p1", required=false)String pname, @RequestParam(value="ptype", defaultValue="machine", required=false) String ptype)

Below CURL command get generated and getting Error: Bad Request curl -X GET "http://localhost:8080/product/100{?pname%2Cptype%2C&pname=TV&ptype=Ele" -H "accept: application/json;charset=UTF-8"

Tried checking in petstore, but it has all get services with single attribute. Do we need to make any changes in JS/window

My swagger page is same as https://github.com/swagger-api/swagger-ui/tree/master/dist/index.html with localservice url.

PBondugula avatar May 17 '17 09:05 PBondugula

Can you share your API definition so we can test it?

webron avatar May 17 '17 14:05 webron

Hi Team, after removing the enableUrlTemplating(true) of Docket configuration, its working fine. You can close the ticket. Thanks.

PBondugula avatar May 18 '17 10:05 PBondugula

Thanks for the update.

webron avatar May 18 '17 15:05 webron