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

Fixed fetching namespace options for mounted APIs. #129

Merged

Conversation

dblock
Copy link
Member

@dblock dblock commented Jul 28, 2014

This fixes the scenario where an API is mounted by another API, in the simple case.

There's a bigger issue is that namespaces can nest and that swagger namespaces != grape namespaces, but that's another can of worms, https://github.com/tim-vandecasteele/grape-swagger/issues/130.

@dblock
Copy link
Member Author

dblock commented Jul 28, 2014

@CraigCottingham could use another pair of eyes, please check and merge, thx

@@ -26,8 +40,7 @@ def add_swagger_documentation(options = {})

@combined_namespaces = {}
endpoints.each do |endpoint|
ns = endpoint.settings.stack.last[:namespace]
@combined_namespaces[ns.space] = ns if ns
@combined_namespaces.merge! endpoint.combined_namespaces
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see where endpoint is an instance of Grape::Endpoint. In fact, I'm not seeing where endpoints is defined, either as a method or an variable. Am I just missing it?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is an extension to the Grape class.

@krisalyssa
Copy link
Contributor

@dblock We've got a merge conflict now. Can you resolve it, please?

@dblock
Copy link
Member Author

dblock commented Aug 6, 2014

The fix in #136 is better, I am merging just the specs from my PR.

dblock added a commit that referenced this pull request Aug 6, 2014
…-apis

Fixed fetching namespace options for mounted APIs.
@dblock dblock merged commit 634c96c into ruby-grape:master Aug 6, 2014
@dblock dblock deleted the fix-namespace-options-for-mounted-apis branch November 29, 2014 17:01
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