-
Notifications
You must be signed in to change notification settings - Fork 167
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
Pre parsing validation #186
Comments
Forms are used to validate values sent over the wire - how can you submit an object value to it? I'm definitely on board with adding In other words, the |
Ok. I understand. I explain my use case. |
I'm all about adding explicit |
If I have a field And And now after writing this I realize that you are the maintainer of one of the major such parsing libraries @ljharb: https://github.com/ljharb/qs 😅 Would it maybe be better to ignore the data when parsing, rather than type casting it? Lines 24 to 26 in 3fb0edc
Lines 114 to 119 in 3fb0edc
Or maybe even throw an exception if the data is set, but is set to something else than a string in eg. those two cases? |
I've read the following issue: #166 and I'm wondering how we can enforce type validation (using is module or node-validator).
If you submit an object to a string field, it is viewed as valid (
"[Object object]"
). Of course, I don't think it is the desired behaviour. What do you think about it?Or maybe providing a generic field and we add this kind of validation:
The text was updated successfully, but these errors were encountered: