-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Request: Warn when functions are passed unexpected arguments #1009
Comments
This seems like a pretty random assumption, why max ? Will take a PR including all the types. |
guys I got some free time if none of you is working on this PR I'm available to work on this one, lmk. |
@ar4mirez feel free to submit a PR! |
Guys quick question I have a solution done for the first level types Thanks. |
Not for now, most inputs are validated or mistakes can't be avoided. |
Alright make total sense to me, I'll PR then what I have and receive your feedback. |
This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions. |
Context
What are you trying to achieve or the steps to reproduce ?
We had a developer, who after working with
Joi.object
for a couple validations assumed thatJoi.string
would also have a default behavior when passed an argument (this default behavior being to enforce a max). I realize this assumed behavior is not documented anywhere, but I think it would be nice ifJoi.string
and other similar validators that don't accept an argument would warn you of that if you pass them something.Which result you had ?
Joi.string
silently accepted the argument, doing nothing with it.What did you expect ?
A Joi error indicating that
Joi.string
does not accept any argumentsThe text was updated successfully, but these errors were encountered: