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
endDid 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.