joi
joi copied to clipboard
Empty string not allowed?
I have a form which the user can fill or not leaving empty field. Is there are way to make this pass:
var Joi = require('joi');
var test = Joi.string();
Joi.validate('', test, function (err, value) {
// this does error here
});
Thank you!
@benjaminlees @NataliaLKB
You might try Joi.string().empty('');
2nd sentence of the string documentation.
Coding for too long! Should have noticed that! Thanks guys!