1.5.x: ApiImplicitParams annotation is ignored
When I first noticed this bug I thought it happens only when I use ApiParam and ApiImplicitParams at the same time.
Looks like ApiImplicitParams is ignored in any case. As result I can't document security token which intercepted by servlet filter earlier.
Here is endpoint
@GET
@Consumes("text/plain")
@Produces(MediaType.APPLICATION_JSON)
@Path("testParams")
@ApiOperation(response = String.class, value = "Returns string with provided parameter")
@ApiImplicitParams({@ApiImplicitParam(name = "token", required = true, dataType = "string", paramType = "query", value = "API token")})
public String testParams(@ApiParam(required = false, value = "ID of timesheet") @QueryParam("id") int id) {}
Example project is located at https://github.com/cppexpert/broken_swagger_jaxrs_integration
Will check that, but spec-wise, you're probably better off describing it as a security definition and not as an operation parameter.
According to earlier conversation here (in another issue) security definition is not going to work for me for multiple reasons one of which is lack of support of unauthenticated endpoints.
Can you refer me to that discussion please?
https://github.com/swagger-api/swagger-core/issues/889
And even "api_key" wasn't working in my sample app anyway. Filling out that field in swagger-ui never passed it with the request.
Hi Ron! Could you please tell me what rough ETA for the fix is ? Thanks!
A release should be around next weekend. The fix may be available earlier via a snapshot.
How is it going with new release, guys ? This bug is quite critical too https://github.com/swagger-api/swagger-core/issues/847
Hi @cppexpert M2 is off by a week. I can certainly do a point release of M1.
Watch for 1.5.3-M1 in a bit.
1.5.3-M1 is now released. It should appear in maven central shortly
But neither #847 nor #905 are fixed in 1.5.3-M1, right ?
Implicit params are supported (was the original issue posted here). Did you look at the fix in the sample project you provided?
The model issue #847 is not quite done yet.
I tried using 1.5.3-M1 with my work project. Implicit parameters are still not visible.
I am having the same problem with the ApiImplicitParam annotation. I spent some time looking over the latest code (1.5.0-M2) and couldn't see any references to this annotation in any of the source code. I did see a reference in the old 1.3.12 code (in the JaxrsApiReader.scala class). I think the equivalent class for 1.5 would be the Reader class, but couldn't find an equivalent code block.
This implicit parameter code path should be well tested. If you can please provide an example of what is not working we can figure it out.
Hi @fehguy. The simplest test I could devise was the following:
- Downloaded the latest swagger-core code from master (which is currently 1.5.1-M2).
- In the samples/java-jaxrs project, edited the
PetResourceclass by adding the following annotation to thegetPetByIdmethod:
@ApiImplicitParams({
@ApiImplicitParam(name = "sort", paramType = "query", dataType = "string", required = false, value = "Comma-delimited list of fields to sort by.")
})
- [I also changed the description of the operation to make sure that I was seeing my latest changes.]
- Ran the sample project with the maven jetty command.
- Viewed the new documentation in a local swagger-ui instance. The implicit parameter is not displayed.
Any update on this issue? It seems that there is no reference of @ApiImplicitParams in source code even though the documentation is complete.
Yes, it's a defect. Working on it.
Any update on this? Can I help at all ?
It will be handled soon.
sorry, maybe a bit off the topic, I also ran into an issue with @ApiParam swagger-core 1.5.1-M2. I wrote a customized SwaggerSpecFilter to filter out some internal param. Whenever I tried to access the "access" property of Parameter in method isParamAllowed, it's alway null. Is this feature missing in 1.5.1-M2?
Thanks,