-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Exposing the set of rack routes built by Grape #53
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
Conversation
OK, feel free to go ahead and make this happen (it can't be auto-merged). |
Exposing the set of rack routes built by Grape
Exposing the set of rack routes built by Grape
What happened to the routes method? Is there a current way to accomplish this? Current grape gives me:
|
It should be working just fine, but it's a class method on the API.
|
Hmmm... perhaps it only works when grape is mounted in Rails 4? We are on Rails 3.2.18:
|
I think the fact that my Grape API class is not a Grape related thing might be the problem.
|
Nevermind, thanks for rubber ducking. For future googlers, I have this setup: definition of the class is like this:
So Root, is what I mount in my app... but Grape is buried inside it.
And this does work:
|
👍 |
Grape APIs can now be inspected. It now exposes an array of API versions and an array of compiled routes. Each route contains a prefix, version, namespace, method and path.
This allows to build dynamic documentation and stuff like that. The possibilities are endless, the world is ours!
You can store additional information with routes and inspect it.