-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
feature(#2290): Use a param value as the default
value of other param
#2371
Conversation
default
value of other paramdefault
value of other param
4c66ce8
to
08eaf10
Compare
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.
Very nice! Yes, let's make this 2.1.0 in this PR. Thanks.
08eaf10
to
325c837
Compare
Thanks @dblock ! I've just updated the version to |
Stable release mentions 2.0.1 too, needs to be 2.1.0, thanks! https://github.com/ruby-grape/grape#stable-release |
Sure! I've just commit the change for updating the stable release section :) Hope it helps! |
README.md
Outdated
@@ -1242,6 +1242,17 @@ params do | |||
end | |||
``` | |||
|
|||
You can use the value of one parameter as the default value of some other parameter. In this | |||
case, if the `primary_color` parameter is not provided, it will have the same value as the `color` | |||
one. If both of them not provided, both of them will have `blue` value. |
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.
One last thing, I promise that's it after that. We don't wrap text in markdown manually since it shows up, make this all 1-line.
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.
Hi @dblock ! Don't worry at all, I really appreciate the reviews :)
I've just updated my addition to the README file for following 1-line format. However, I did it in that way because all the other sections of the document.
As you can see here:
https://github.com/ruby-grape/grape/blob/master/README.md?plain=1#L153-L159
If the 1-line is the new convention you want to follow, do you think I can help on moving all the README to 1-line format?
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.
Absolutely. Maybe we can find a linter to run in PRs too?
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.
Sure! Let me try to PR this :)
Merged, thanks for hanging in here with me! |
Hey! 👋
I think the feature requested in #2290 is pretty interesting. So I've added this PR for allowing to use a param value as the
default
value of some other parameter.So now, we can do:
I've updated the README for including this new feature. Don't know if the next version should be
2.1.0
instead of2.0.1
. Let me know if I should change it.Thanks!!