-
Notifications
You must be signed in to change notification settings - Fork 472
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
Grape deprecated passing options hash to desc #594
Comments
heap , this warning exists since grape 0.15.0, but it doesn't mean one can not provide options, this can be done in a block … desc 'get an object' do
hidden true
end |
@LeFnord that example was the first thing I tried. It gives me this error:
|
it is a bit curious, cause there is a spec (https://github.com/ruby-grape/grape-swagger/blob/master/spec/swagger_v2/hide_api_spec.rb) which exactly uses your first version, without any warnings → have a look on the travis builds the the second version raises an error, sorry I forget, that all methods of the block must be defined for grape, that is why I personally prefer the hash style, it is much more flexible and more independent form grape by the way, have a look on the specs, the hash style is very often used, without any problems |
Does this cover the |
It is now deprecated to pass an options hash to
desc
in grape like this:As shown here:
https://github.com/ruby-grape/grape/blob/master/lib/grape/dsl/desc.rb#L50
And (as far as i can tell) passing options like that no longer has an effect when using the latest versions of grape and grape-swagger.
For example, that line above doesn't seem to hide the endpoint.
The grape project seems to prefer setting options like this now:
As described here:
https://github.com/ruby-grape/grape#describing-and-inspecting-an-api
Am I missing something?
Would you be interested in a pull request that takes this into account?
The text was updated successfully, but these errors were encountered: