-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Setting a string as non-required don't allow to use nulls as its value
Enviroment
- MacOS Mojave@10.14.5
- Hubi@4.9.0
How to reproduce
name: Foo
attributes:
- name: optionalString
required: false
default: nullExpectations
Expected Behaviour
let success = false
try {
Joi.attempt({ optionalString: null }, Foo.SCHEMA);
success = true
} catch(e) {
}
assert.ok(success, 'optionalString should be possible to be set to null')In the code above the assert.ok should not fail
Actual Behaviour
It fails with the message "[1] "optionalString" must be a string"
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working