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 Request - Boolean type cast #991
Comments
It doesn't look like it is supported currently based on the code for that to be converted (or for the Boolean to be configured to override the flags). I'm sure your PR would be reviewed if you wanted to add a new set of values there, personally I'd love to see Boolean take some configuration like this: var obj = Joi.object().keys({
enabled: Joi.boolean({
truthyStrings: ['yes', 'y', 'true'],
falseyStrings: ['no', 'n', 'false']
}).required();
}); |
My thoughts precisely. I think I'm going to make this a breaking change and accept configuration. |
I'd go for an API like |
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
Feature
Is it possible to add "Y" and "N" in boolean type cast? MLS & bunch of state tax record data often do "Y"
The text was updated successfully, but these errors were encountered: