-
Notifications
You must be signed in to change notification settings - Fork 39
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
Not allowing empty string #41
Comments
You should probably look at joi docs for joi usage, not here. The answer is |
Yeah I tried that and for some reason I'm getting a 400 bad request. I am using Node.js for the back-end and I made sure that this field is not required in my modal, something I can confirm using Postman. This must be a joi related issue (or something else is wrong with my code). When catch the
The message is the same I was getting in the errors object before using |
Ok I solved the issue. In my back-end joi validation schema I had to add It is weird though... How come using Postman I was not getting any errors when passing an empty string, the joi validation should've thrown an error because I didn't specify |
Hard to tell without code. |
It seems like joi browser does not allow to have empty string. This is my schema:
If I leave the subHeading field empty (because it is not a required field) I get an error: ""subHeading" is not allowed to be empty"
Is there anyways to allow empty string in the validation?
The text was updated successfully, but these errors were encountered: