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

Ifeelgoods generate api route #2

Merged

Conversation

iNecas
Copy link

@iNecas iNecas commented Dec 17, 2014

I've added some more customization possibilities via configuration.

I've also changed removing the '()' from the path, as this probably depends on the usage and people might have different preferences that can be customized by the custom formatter: therefore I find it better to keep the info there in the base and removing it later, as the other way around, we loose the information at the beginning and we can't do anything about that in the custom formatter.

I've also change the way it handles the api_base_url, as the previous version was not working when customizing the api_base_url from resource description. After this change, it just doesn't try to modify the apis that come from the routes.

I've also removed the initial filtering base on the api_base_url (for similar reasons) and enhanced support for engines.

Ability to specify the formatter thought the configuration and
influence the other +api+ paramters (such as desc) form the formatter.
Adding a recursion for getting routes form mounted engines.

Also checking if we need to add the api_base_url to the path instead
of removing the api_base_url when loading the path from routes:
doesn't play well with inheritance of api_base_url.
route_set.routes.each do |route|
if route.app.respond_to?(:routes) && route.app.routes.is_a?(ActionDispatch::Routing::RouteSet)
# recursively go though the moutned engines
flatten_routes.concat(rails_routes(route.app.routes))
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@mtparet
Copy link

mtparet commented Dec 17, 2014

👍

mtparet added a commit that referenced this pull request Dec 17, 2014
@mtparet mtparet merged commit e494e62 into ifeelgoods:generate_api_route Dec 17, 2014
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

Successfully merging this pull request may close these issues.

2 participants