Closed lu7766lu7766 closed 1 year ago
The string validation has not failed. It is the required validation that has failed and an empty string has no value.
The behavior is very much intended and we will not change it. If you are trying to achieve some workflow with an empty string, then please explain that as a discussion thread
Dear maintainers,
I found an issue while using AdonisJS validation with schema.string(). When attempting to validate an empty string, an exception is thrown instead of properly validating the input. This behavior is inconsistent with the intended functionality of the validation system.
Here is the code snippet I'm using:
When the
data
object contains an empty string for thename
field, validation fails and throws the following exception:But i think "" is valid string too or how could i make it right, i want the
name
required and can be empty, i had try nullable, optional, nullableAndOptional, these all not what i want.It would be great if you could take a look at this issue and provide a fix or workaround. Thank you for your hard work on this project.
Package version