-
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
failover() support for default on errors #1535
Comments
@Marsup I see that you added this to the Priorities project. If you're open to this addition, I can go ahead and work on it. |
It's a P3 but sure. Remember there's already a 2nd argument for default. |
👍
My thought was apply only to empty/undefined values as it currently does, unless you have set the |
What if you only want invalid ? |
I guess that's something we need to decide on, then. My understanding of the original request was "invalid in addition to empty". So if we need to consider "empty", "invalid", and "empty or invalid" as individual use cases then yeah this is a bit confusing. |
Describe the problem you are trying to fix (provide as much context as possible)
From the discussion here:
per @genediazjr
Which API (or modification of the current API) do you suggest to solve that problem ?
I would like to propose adding an optional
config
param to.default()
:Joi.string().default('name', { invalid: true })
Are you ready to work on a pull request if your suggestion is accepted ?
Yes.
The text was updated successfully, but these errors were encountered: