Swagger-ui: Try it out - doesn't pass query string params (for ApiImplicitParams)

Created on 19 Sep 2014  路  1Comment  路  Source: swagger-api/swagger-ui

I have added the following to my API method:

@ApiImplicitParams(
        @ApiImplicitParam(name = "articleId", value = "Example context parameter for the rules engine", dataType="String")
)
public Response authorizeTextPlain(@Context HttpServletRequest request) throws Exception

As it happens this method can take arbitrary params, and it would be great if Swagger UI could show a dynamic form allowing the user to enter name/value pairs (enhancement request). What I'm trying to do here though is show an example parameter at least.

The JSON is generated correctly with the parameter, and Swagger UI shows it, but it doesn't pass it when you click Try it out!

image

(it's not just a UI issue with the displayed url - parameter is not sent)

Thanks

Most helpful comment

Apologies, I needed to set the paramType="query". For anyone stuck on this, the annotation looks like:

@ApiImplicitParams(
        @ApiImplicitParam(name = "articleId", value = "Example context parameter for the rules engine", paramType="query", dataType="String")
)

Am just getting started with Swagger and Swagger UI but very promising!

>All comments

Apologies, I needed to set the paramType="query". For anyone stuck on this, the annotation looks like:

@ApiImplicitParams(
        @ApiImplicitParam(name = "articleId", value = "Example context parameter for the rules engine", paramType="query", dataType="String")
)

Am just getting started with Swagger and Swagger UI but very promising!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ankon picture ankon  路  4Comments

fehguy picture fehguy  路  3Comments

MartinMuzatko picture MartinMuzatko  路  4Comments

DavidBiesack picture DavidBiesack  路  4Comments

andrecarlucci picture andrecarlucci  路  3Comments