-
Notifications
You must be signed in to change notification settings - Fork 3
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 defaultValue for method parameters #57
Conversation
waits #56 |
| name | String | Parameter name | | ||
| description | String | Parameter description | | ||
| \[type\] | String | Parameter type (String, Number, Boolean, etc.) | | ||
| \[defaultValue\] | Any | Default value of the parameter | |
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.
Have you considered default
instead of defaultValue
?
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.
Nope.
Do you think default
is clear? Is it default for type
? for name
?
Maybe these questions are only in my head :)
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.
In time the Value
-part of this property will seem redundant :)
Also joi names it default, though it's a method.
Let's ask @dodev :)
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.
I think that default
can only be associated with value for a parameter, since it has it's name already declared. The only possible mistake that comes to mind is defaultType
, but the existence of such a 'thing' seems unlikely and that's what JSDoc is for.
For me it's not a big deal, but since you're asking my opinion, I vote for default
, because it's shorter + the above.
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.
Browser support for reserved words as properties
Public interface is always painful to change, so I thought it's better to bring this question up before feature release. )
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.
I'm OK with defaultValue
, too, if default
would be a problem because is reserved
Decided to keep |
Add defaultValue for method parameters
No description provided.