swagger-api / swagger-core

Examples and server integrations for generating the Swagger API Specification, which enables easy access to your REST API
http://swagger.io
Apache License 2.0
7.36k stars 2.17k forks source link

@Api @Path & ApiListing #196

Closed arminbhy closed 11 years ago

arminbhy commented 11 years ago

Hi,

I'm trying to use swagger as I find it neat and all, I've got it all setup nicely pretty much; the only thing that I don't see proper support for is nested paths, essentially I want to have versioning on my resources something like /v1/resource /v2/resource, and having the following, having base path set to /api, doesn't work properly: @Path("/api/v1/sandwich") @Api(value = "/v1/sandwich", description = "Operations on Sandwiches")

Seems like ApiListing is using only the Api.value to build the resource paths... as oppose to the @Path value.

I was wondering if this is something on the agenda, or already resolved?

fehguy commented 11 years ago

hi, it is true that the @Api annotation is used to bind to documentation paths, not necessarily to the @Path annotations. But if you're using 1.2.4-SNAPSHOT this should work fine. Can you please describe what you're trying to do in more detail, and/or try the snapshot?

arminbhy commented 11 years ago

Seems like i'm on 1.2.0 for swagger-jaxrs_2.9.1, basically i have everything working with the swagger UI version swagger-ui-1.1.7, but I like to add versions and that seems not to be working correctly as mentioned. I can switch to 1.2.4 and see if that resolves the issue.

arminbhy commented 11 years ago

is 1.2.4-SNAPSHOT available? I dont' seem to be able to find it via my pom file, can access 1.2.3 though.

fehguy commented 11 years ago

See here:

https://oss.sonatype.org/content/repositories/snapshots/com/wordnik/swagger-core_2.9.1/1.2.4-SNAPSHOT/

you probably need sonatype snapshots in your repository list

arminbhy commented 11 years ago

Thanks, i'll try it out.

arminbhy commented 11 years ago

Awesome, switching to 1.2.4-SNAPSHOT fixed the issue! Thanks!

fehguy commented 11 years ago

great news. Will try to push 1.2.4 release shortly

arminbhy commented 11 years ago

Great thanks!