When validating strings with Joi, with the following schema:
title: Joi.string().required(),
It's not validating empty strings like the following: " ". I don't think it's correct to repeat string().trim() on every field. How can I validate empty strings? Shouldn't Joi handle this, according to the docs?
Note that the empty string is not allowed by default and must be enabled with allow(''). Don't over think, just remember that the empty string is not a valid string by default. Also, don't ask to change it or argue why it doesn't make sense. This topic is closed.
''and' 'are two different things, you need to trim in your case. The quoteDon't over think, just remember that the empty string is not a valid string by default.is referencing the behaviour you can see betweenBoolean('')andBoolean(' ')- N.J.Dawson