It seems like joi browser does not allow to have empty string. This is my schema:
schema = {
_id: Joi.string(),
heading: Joi.string()
.min(5)
.max(50)
.label("Heading")
.required(),
subHeading: Joi.string().max(50)
};
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?
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?