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

Add params_like :method #55

Closed
Pajk opened this issue Aug 29, 2012 · 1 comment
Closed

Add params_like :method #55

Pajk opened this issue Aug 29, 2012 · 1 comment
Labels

Comments

@Pajk
Copy link
Member

Pajk commented Aug 29, 2012

Now there is 'see :method' available in DSL, it maybe does make sense to use it in few cases but much more helpful feature would be the possibility to say 'method A has same parameters as method B'. Almost every #update method has same params as #create method.

Possible solution:

api :PUT, '/resource'
params_like :create
def update; end

When asking for #update parameters description, apipie would take those from #create method.

@iNecas
Copy link
Member

iNecas commented Sep 3, 2012

Or maybe param group. Let's say

param_group :person do
  param :first_name
  param :last_name
end

That explicitly states that this list is meant to be shared which is not so obvious, when using the params_like: in your case, I can imaging the situation, that new param will be added for create method, but the author doesn't realize, that this will cause also updating the update documentation.

@Pajk Pajk closed this as completed Dec 13, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants