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

Broken nested scoping #256

Closed
ralphie02 opened this issue Jan 27, 2016 · 7 comments
Closed

Broken nested scoping #256

ralphie02 opened this issue Jan 27, 2016 · 7 comments

Comments

@ralphie02
Copy link

I believe scope nesting for the api request parameters are either not properly documented, or broken.
I am trying to do something similar to below:

get '/api/something" do
  parameter :person, "description", scope: :company
  parameter :name, "description", scope: [:company, :person]
end

for a parameter like this -> company[person][name]

but instead it creates something similar to this -> [:company, :person][name] [:company, :person][name]
and yes, there's 2 of the parameter names above this line

I could definitely be wrong and that this feature is already implemented, I'm just using it wrong. If I am, please let me know.

@oestrich
Copy link
Contributor

oestrich commented Feb 1, 2016

What are you using to view the documentation? There is a good chance they just need to be updated to understand the new scopes.

@ralphie02
Copy link
Author

I'm not using any specific viewer such as the ones mentioned in your documentation. I'm just viewing the simple HTML file generated by rake docs:generate

Is there a workaround for this?

@DevilsNightsix
Copy link

@ralphie02 You need to install Apitome from github master branch
add to your Gemfile

gem 'apitome', github: 'modeset/apitome'

@ralphie02
Copy link
Author

@DevilsNightsix I was hoping I didn't have to install any doc viewer. Thanks for getting back to me!

@myabc
Copy link
Contributor

myabc commented Jun 26, 2016

I can confirm that this is still broken on master

response_field :id, 'Feedback ID', scope: [:comment, :feedback]

will render the following with both HtmlWriter and SlateWriter:

[:comment, :feedback][[:comment, :feedback][id]]

@DevilsNightsix
Copy link

Hello @myabc
I have made fix for this issue
If you want, you can use my fork of Apitome

@myabc
Copy link
Contributor

myabc commented Jun 26, 2016

@DevilsNightsix I'm not actually using Apitome, but thanks anyway!

myabc added a commit to myabc/rspec_api_documentation that referenced this issue Jul 2, 2016
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

4 participants