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

Allow body parameter name to be specified #607

Merged
merged 1 commit into from
May 5, 2017

Conversation

tjwp
Copy link
Contributor

@tjwp tjwp commented May 4, 2017

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 a Grape::Router::Route, so they are updated accordingly.

@tjwp tjwp force-pushed the salsify/body-name branch 3 times, most recently from bd30160 to 9127a2f Compare May 4, 2017 19:30
@coveralls
Copy link

coveralls commented May 4, 2017

Coverage Status

Changes Unknown when pulling 9127a2f on salsify:salsify/body-name into ** on ruby-grape:master**.

Copy link
Member

@LeFnord LeFnord left a 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?
Copy link
Member

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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please re-add it

@tjwp tjwp force-pushed the salsify/body-name branch from 9127a2f to 17e47d8 Compare May 5, 2017 13:17
@tjwp
Copy link
Contributor Author

tjwp commented May 5, 2017

@LeFnord feedback addressed. Thanks for the quick review!

@LeFnord
Copy link
Member

LeFnord commented May 5, 2017

thanks for the quick response 😄

@LeFnord LeFnord merged commit 3493e3c into ruby-grape:master May 5, 2017
LeFnord pushed a commit to LeFnord/grape-swagger that referenced this pull request Feb 9, 2019
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.

3 participants