-
Notifications
You must be signed in to change notification settings - Fork 471
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
Multiple swagger endpoints for multiple API versions? #141
Comments
I think half of the problem is that Grape namespaces != grape-swagger namespaces. Grape-swagger just magically believes that the first part of the path is a namespace. Throw in versioning and it gets even more confused. I think we need to fix that first and then we can also start distinguishing various API mounts from a single |
still an issue? |
It does work, you just need to specify different |
@yeonhoyoon don't suppose you can explain how to get that to work? i'm giving it try just now but not really having much luck. |
class FooApiRoot < Grape::API
mount CarApi
mount TrainApi
add_swagger_documentation(...)
end class BarApiRoot < Grape::API
mount DogApi
mount CatApi
add_swagger_documentation(...)
end You will have two different swagger endpoints with the above setup. |
that does help, thanks! |
Currently experiencing this problem. We use the Example:
In this example, when attempting to access either |
update - getting rid of |
With |
@morcoteg how do you access swagger docs with this
how BASE_URL/docs 'll differentiate b/w v1_swagger & v2_swagger |
Is there a way to do this, or am I missing something... ?
I have:
Within each of those mounted classes, I specify the proper version, so there are two discrete versions in my API system ("v1" and "admin.v1")
add_swagger_documentation
works, and documents all of the endpoints on all of those API mounts, but I get a bunch of duplicates -- /robots (v1) and /robots (admin.v1), for example -- with no real way to distinguish them, since Swagger UI doesn't know how to distinguish.What I would like to do is be able to
add_swagger_documentation
for all the V1s responding to "/docs/v1" and all the admin endpoints responding to "/docs/admin.v1" ... so effectively it would be running grape-swagger twice, but separating those versions. And then I can just point Swagger UI at whichever URI I want, depending on which version of docs I want to look at.Is this supposed to work automatically with grape-swagger, or am I missing something?
The text was updated successfully, but these errors were encountered: