-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Extracted endpoint dsl #716
Extracted endpoint dsl #716
Conversation
Good. This gives us a lot of spec work that will make those tests much more specific. |
👍 |
Note that this removed |
@dspaeth-faber pls comment on ^^^^, thanks |
@dblock Sorry, I think I need more coffee :) I did have a look here v0.8.0 I couldn't see this
In the released version you still have to call
When you don't extend you'r module with module Grape
module API
def self.const_missing(name)
if name.to_sym == 'Helpers'.to_sym
warn 'Grape::API::Helpers is deprecated use Grape::DSL::Helpers::BaseHelper instead'
const_set(name, ::Grape::DSL::Helpers::BaseHelper)
else
super
end
end
end
end Did I delete the spec for this behavior or does none exists? |
When I think a little bit more about it, it makes no sense to define params inside a Helper module. Maybe: class MyApi < Grape::API
define_params 'a name' do
# define your params
end
use_params 'a name'
get '/' do
end
end
|
Lets bring the discussion to #735, thanks. I think the spec never existed. I think that for the end user renaming |
In that case, how should I share reusable params between mounted endpoints? BTW,
Helper module methods are methods on "Enpoint-Instance" level. @dblock @dspaeth-faber guys, you can destroy this mechanism and use just "raw" ruby modules but I have a question.. Do you use this feature? |
Additional to #714 I extracted also Endpoint specific DSL.