-
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
Allow body parameter name to be specified #607
Conversation
bd30160
to
9127a2f
Compare
Changes Unknown when pulling 9127a2f on salsify:salsify/body-name into ** on ruby-grape:master**. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @tjwp … the comments are minor and no blockers
@@ -42,9 +42,9 @@ def parent_definition_of_params(params, path, route) | |||
|
|||
move_params_to_new(definition, params) | |||
|
|||
definition[:description] = route.description if route.respond_to?(:description) | |||
definition[:description] = route.description if route.try(:description).present? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
think the present?
isn't needed here
CHANGELOG.md
Outdated
@@ -2,7 +2,7 @@ | |||
|
|||
#### Features | |||
|
|||
* Your contribution here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please re-add it
@LeFnord feedback addressed. Thanks for the quick review! |
thanks for the quick response 😄 |
For deeply nested resources, the generated name for a body parameter, based on the operation, can get very long. This change allows the generated name to be overridden using a
:body_name
option on the desc.While adding tests for this, I found that the relevant specs used a
Grape::Request
while the actual object that is passed is aGrape::Router::Route
, so they are updated accordingly.