Skip to content
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 support for validating boolean values #46

Open
muneer-memon opened this issue Nov 12, 2024 · 0 comments
Open

add support for validating boolean values #46

muneer-memon opened this issue Nov 12, 2024 · 0 comments

Comments

@muneer-memon
Copy link

the transformValidationOption allows to convert string to type values using enableImplicitConversion option

const transformedValidatedValues = await transformAndValidate(
schema,
requestPayload,
{ transformer: { enableImplicitConversion } } // E.g. string numbers will be converted to type number
);
however there is one issue. if your schema specifies one boolean property and the request payload pass any string other than 'true' or 'false' the transformer converts it into true.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant