Answer the question
In order to leave comments, you need to log in
How to fill an object field in npm Joi if it is missing?
I couldn't find an answer to my question in the documentation.
In general, I accept data from the form, and some fields may be empty, Joi in the case of an empty field starts to swear at him.
For example, there is such data to check
var data= {
"price": ''
};
// Пишу схему для проверки
var schema = Joi.object().keys({
"price": Joi.number().min(0).max(10)
});
Answer the question
In order to leave comments, you need to log in
I have those that are not required to be filled with Joi.string ()
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question