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

[feature] Grape routes #24

Open
ZeroInputCtrl opened this issue Jul 7, 2016 · 5 comments
Open

[feature] Grape routes #24

ZeroInputCtrl opened this issue Jul 7, 2016 · 5 comments

Comments

@ZeroInputCtrl
Copy link

There is a gem called "grape_on_rails_routes". It would be nice if this gem is installed (or a setting to change) to use "rake grape:routes" so this plugin will pick up routes from grape instead.

@basgren
Copy link
Owner

basgren commented Jul 8, 2016

Hi.
Please open Railways settings (there's a button in Routes panel next to "Update route list" button) and set "Rake task name" parameter to grape:routes. This setting is project-wide, so other projects won't be affected.
Please let me know if it works for you.

@ZeroInputCtrl
Copy link
Author

ZeroInputCtrl commented Jul 8, 2016

This works but it can't seem to parse the path/action correctly. I think it's because they are different formats. The verb is being detected perfectly fine though.

@ZeroInputCtrl
Copy link
Author

This is what the output looks like on each line, method, endpoint path, api version, description

Majority of endpoints use the api version at the beginning and all use (.:format) at the end.

DELETE | /:version/static_endpoint_path/:endpoint_variable(.:format) | v1 | Endpoint description

@basgren
Copy link
Owner

basgren commented Jul 8, 2016

Hmmm... I see. Thank you for the information. While it's not hard to parse string of this format, but I need to find all possible formats of route output to parse well, otherwise output may be messy. Could you please provide more samples?
Another solution would be to add another output format to grape_on_rails_routes gem itself. I'll think about it too.

@ZeroInputCtrl
Copy link
Author

This is the only other thing i can think of, it's a base route so it doesn't have a api version. the url variables (:variable) can be anywhere in the route with as many of them in it.

GET | /swagger_doc/:name(.:format) | | Swagger compatible API description for specific API

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants