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

Multipart FormData - Boolean validation issue #992

Open
elvince opened this issue Oct 8, 2024 · 2 comments
Open

Multipart FormData - Boolean validation issue #992

elvince opened this issue Oct 8, 2024 · 2 comments

Comments

@elvince
Copy link

elvince commented Oct 8, 2024

Describe the bug
If I send a multipart form data (File + Body), the body validation failed due to a boolean in it.

To Reproduce
Send a multipart form data with boolean in it. Add the validation middleware with a boolean required in the validatin schema.

Actual behavior
Failed with "XXX must be boolean" while the value is "true" in the form data string.

Expected behavior
This validation should not failed as coercevalues is set to true by default.

I saw different issue on this in the past, may be there was a regression somewhere? or in AJV?

thanks,

@elvince
Copy link
Author

elvince commented Oct 8, 2024

by reading again the docs, it seems that coercevalue is not applied to body, is that correct?

If so, how should we handle this case?

Thanks,

@elvince
Copy link
Author

elvince commented Oct 24, 2024

Any tips to solve this case?

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