The mixed.oneOf doesn't accept null when nullable is added.
Example
const fruitsOrNone = yup.string().oneOf(['apple', 'banana']).nullable(true)
fruitsOrNone.validate(null) // => throws ValidationError: 'this must be one the following values: apple, banana'
fruitsOrNone.validate('apple') // => apple
Expected
It's expected to accept the value null when nullable is set on the schema.
The
mixed.oneOfdoesn't acceptnullwhennullableis added.Example
Expected
It's expected to accept the value
nullwhennullableis set on the schema.