I am using swagger-2.9.1_1.2.5 to document my rest API. I have one rest call which is as follows
@GET
@Path("/")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
@ApiOperation(value = "Get user",
responseClass = "com.thed.rpc.bean.RemoteUser")
@ApiErrors(value = { @ApiError(code = 400, reason = "Invalid criteria supplied"),
@ApiError(code = 404, reason = "User not found with provided criteria") })
public Response getUsersByCriteria(
@ApiParam(value = "Token fetched from cookie", required = false) @CookieParam("token") Cookie tokenFromCookie,
@ApiParam(value = "Query params passed in URL.", allowMultiple = true, allowableValues = "id, name, startdate, enddate, status", required = false)
@Context UriInfo uriInfo) {..........}
So my rest API are supposed to fetch query parameters from the URI and process accordingly.
Now when I give the URL
http://localhost:8002/api/api-docs/usersI get only one parameter i.e. token but not UriInfo. Is it intentional that parameters annotated with @Context annotation are not supposed to be taken as a parameter in swagger UI? If yes then how can I pass query parameter using swagger UI?
Thanks,
Pratz