- Notifications
You must be signed in to change notification settings - Fork 96
Closed
Labels
Description
Description
I do not know if this behaviour is by design or not but when I declare some prop like this one:
const schema = { Status: { type: 'string', uppercase: true, enum: ['a', 'b', 'c'], optional: true, nullable: true } } validate({Status: ''}, schema)the validation process fails inferring that the empty value '' is not in the stringEnum, even if I've specified the optional and the nullable features. Is this by design? Or shouldn't be the null and empty string, in this case, considered as part of the enumeration or checked before validating the enum? If so it should be documented or at least using optional or nullable with enum should throw an exception...