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

make api doc name param recognizable by declared #284

Merged
merged 1 commit into from
Aug 10, 2015

Conversation

calfzhou
Copy link
Contributor

I use a after_validation to my api to make sure that all endpoints only get declared params, code sample like:

after_validation do
  @raw_params = params
  @params = declared(params, include_missing: false)
end

But this will make swagger doc not available, because this after_validation also applies to swagger doc related endpoints, but the required param :name cannot be recognized by declared.

So i made this PR to make swagger doc endpoints' :name param being declared.

@dblock
Copy link
Member

dblock commented Aug 10, 2015

Yes, this is much better and now actually possible. The old syntax is from a very old version of Grape.

dblock added a commit that referenced this pull request Aug 10, 2015
make api doc `name` param recognizable by `declared`
@dblock dblock merged commit 6cb51ae into ruby-grape:master Aug 10, 2015
@dblock
Copy link
Member

dblock commented Aug 10, 2015

I merged a bit too quickly, I think a CHANGELOG line is actually useful here, if you can please PR one?

calfzhou added a commit to calfzhou/grape-swagger that referenced this pull request Aug 11, 2015
dblock added a commit that referenced this pull request Aug 11, 2015
add #284 to CHANGELOG; also fix minor typo
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

Successfully merging this pull request may close these issues.

2 participants