-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Subresource scanning based on @ApiOperation #942
Comments
I feel that the first @ApiOperation :
Maybe could be removed as you defined the @ApiOperation on the GET of the scanned @path("/somePath") resource, which define:
So... In this case, what documentation would shown? "Returns Some service", "get tenants" or both... |
@jmarreroc Not sure I understand. The first @path("/somePath") is basically returning a subresource while the second @path("") is just for swagger to scan and pick up that specific subresource method (yes, with the same path). The difference is we don't provide an HTTP method when a subresource is returned. JAX-RS won't understand a @get on a subresource (although I haven't tried it first hand but that's what i'd expect) The "returns some service" api operation actually doesn't do anything from what I can see. It's just a way to let swagger know that this is a subresource and you need to go inside this subresource class to scan the remaining methods (and corresponding paths). So you will only see the documentation for "getTenants" (as expected) |
Ok, so finally swagger shown only the documentation defined over the HTTP method. Thx! |
That's what I found so far .. yes ! And no problem. |
this is fixed in develop_2.0 |
@fehguy Thank you ! Which snapshot/release I can test this with ? |
If you wait a few, there will be a formal release. I'm verifying for 1.5.0-M2 right now. |
sounds good .. let me know what release .. currently I am on 1.5.4-Snapshot |
@shivangshah - it was indeed released under 1.5.0-M2. |
Fixes #942: Path validation has been fixed.
@shivangshah - this should be fixed in develop_2.0 now. Can you try? |
@webron do you know which snapshot i can test it with instead of branch? (I might not be able to clone the branch and test :( ) |
Fixes #942: Path validation has been fixed.
@shivangshah I don't think we have a published snapshot for it yet, so you'd have to build it on your own. |
@webron I see ok .. when I get a chance, I will build and try it out .. |
@shivangshah - I'm afraid that at this point you'd have to provide us with a sample project that mimics the problem for us to further investigate. |
@webron Let me set one up and send you guys the link soon .. |
Is there still the lack of the example project? It still doen't work. |
Running into the same problem. Only the most trivial kind of JAX-RS application seems to be supported. |
Which version are you using? |
We are using the swagger-maven-plugin version 3.1.3 that is using swagger version 1.5.4 to document our REST services. I hope it's not a bug of the maven plugin itself and should be addressed there. |
Okay, after removing all the @Api and @Api(hidden=True) annotations it worked as intended. Looks like I was just misguided by google and old workarounds/examples still floating around. Sorry for the noise. If someone finds this via google: Resource locator methods do not need any swagger-specific annotation, only Here is a working example:
|
Per discussions on #925 with @fehguy , creating new issue.
Through a subresource, if a path is not given at root level (because it gets subresource'd from inheritance), the api will not show up in swagger. For example:
had to provide @path("") for the swagger scanner to pickup that api. Otherwise it did not recognize the inherited path
The text was updated successfully, but these errors were encountered: