Closed ajimbong closed 1 year ago
Are you really using v13.1.0? It's a 5 years old version, you shouldn't do that.
Also, it's not err
but error
.
Ohh that was my mistake, I should have used error
instead of err
.
And the version I'm using is instead v17.7.0, mistakenly copied the version number of a different package in package.json
.
Thank you very much for your feedback, everything is now working well.
Support plan
Context
Object validation passes even though I provide falsy values to the
schema.validate()
function.How can we help?
I have an Object schema with two properties 'name & age' where name is a string with a minimum length of 5 characters and it is required, the age is a number and it's required too. If I validate this object
{age: '2'}
against this schema, it should return an error because I haven't provided the name and the age value is a string instead of a number. But after testing this, I don't receive any errors. Could there be something I am doing wrong?