Closed johnnymongiat closed 11 years ago
I came across this same issue. It is sort of documented here. What you need is to create a separate resource listing endpoint that will expose the v1/whatever path.
https://github.com/wordnik/swagger-core/tree/master/samples/scala-alt-resource-listing
The result works for us but it does seem a bit flaky. The resources exposed on the v1 path for us don't always show up. We solved this by using a static root resource json which was needed anyways to keep track of separate versions.
Pretty sure this commit to include the nested routes via regex fixes this. Try 1.2.1-SNAPSHOT version vs 1.2.0 and see if it works. https://github.com/wordnik/swagger-core/commit/30db009431f621fa0fc6caf0c73a052ce7ef6c90
Thanks for the suggestions! However, I feel that the "multi-segmented path" should be supported out of the box...
Where can I download the proposed 1.2.1-SNAPSHOT from (I don't see it in maven central)? Is it hosted on another repository?
hi folks, sorry for the delay--they are in sonatype snapshots, here:
https://oss.sonatype.org/content/repositories/snapshots/com/wordnik/swagger-core_2.9.1/
Just add that repo to your repositories
and you'll be golden.
Thanks for the repository info. I can confirm that the 1.2.1-SNAPSHOT does indeed address the original issue!! I really appreciate the help, and the quick responses - well done...
Is there are release schedule for this artifact? I would like to use this version but don't want to hold up my project from releasing because of this SNAPSHOT dependency.
Pushing out a release today, I'll close this issue when it's up.
The source issue is described here: https://groups.google.com/forum/#!topic/swagger-swaggersocket/b0nzZFoY6Uc
As a summary, the issue involves getting a HTTP 404 response when trying to load the expected API documentation (as generated by Swagger) for a rest resource that is annotated with a JAX RS @Path where the value is composed of more than one "path segments", for example,
@Path("/v1/bars") @Api(value = "/v1/bars", description = "Operations related to Bar object(s)") @Produces({ MediaType.APPLICATION_JSON }) public class BarsResource {
}
If the "/v1" portion is removed from the @Path value, thus becoming @Path("/bars") - everything else stays the same, then the documentation is correctly returned (HTTP 200).
Version 1.2.0 (swagger-core_2.9.1 + swagger-jaxr_2.9.1).