Skip to content
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

missing / when concatenating sub-resources creates invalid swagger api-docs #721

Closed
todd-richmond opened this issue Oct 13, 2014 · 2 comments
Labels
Milestone

Comments

@todd-richmond
Copy link

found in 1.3.10

leading / are not required in Jersey annotations so you can have

@Path("foo")
class Foo {
@GET 
public Response getFoo() {
}

@GET @Path("bar")
public Response getBar() {
}

which correctly handles the resource path /foo/bar

However, swagger forgets to include / in concatenations so this converts to 2 api sets - /foo and /foobar instead of /foo/bar. The only workaround I see is to use @get @path("/bar") which does create /foo/bar

Also note that swagger does properly prefix /foo in both basePath, resourcePath and apis/path values so this seems to only be a problem with sub-resources

@webron
Copy link
Contributor

webron commented Oct 13, 2014

Tested and confirmed, issue exists. FYI, it's not related to Jersey, it's the JAX-RS definition of how it should work.

@fehguy fehguy added this to the v1.3.12 milestone Dec 20, 2014
@fehguy fehguy added the Bug label Dec 20, 2014
@fehguy
Copy link
Contributor

fehguy commented Dec 21, 2014

Should be fixed in 6a0d897

@fehguy fehguy closed this as completed Dec 21, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants