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

Parameter 'requires type :hash', wrong render on the UI. #186

Closed
esbanarango opened this issue Dec 17, 2014 · 1 comment
Closed

Parameter 'requires type :hash', wrong render on the UI. #186

esbanarango opened this issue Dec 17, 2014 · 1 comment

Comments

@esbanarango
Copy link

First, thank you guys for this project!

Right now I'm having a problem trying to setup the params to be well represented on the swagger UI. I have this code:

desc "Creates an ink color."
params do
  requires :ink_color, type: Hash do
    requires :name, type: String, desc: 'Color name.'
    requires :hex, type: String, desc: 'Hexadecimal color number.'
    requires :code, type: String, desc: 'Code.'
    optional :hex_gradient, type: String, desc: 'Hexadecimal gradient number.'
    optional :foil_only, type: Boolean, desc: 'Is this ink color foil only?'
    optional :color_default, type: Boolean, desc: 'Default.'
  end
end
post do
  InkColor.create! permitted_params[:ink_color]
end

but then that is translated into this on the UI.

gcc4_api

The ink_color param shouldn't be there.

Not sure if this is an issue or if I'm missing something on the definition.

@esbanarango esbanarango changed the title Parameters 'requires type :hash', wrong render. Parameter 'requires type :hash', wrong render on the UI. Dec 17, 2014
@dblock
Copy link
Member

dblock commented Dec 17, 2014

This is https://github.com/tim-vandecasteele/grape-swagger/issues/91, already fixed on HEAD. There will be a release of grape-swagger right after Grape is released (which should be soon).

@dblock dblock closed this as completed 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

No branches or pull requests

2 participants