If I have two fields, I\'d just like to validate when at least one field is a non empty string, but fail when both fields are empty strings.
Something like this does
If you want to express the dependency between 2 fields without having to repeat all other parts of the object, you could use when:
var schema = Joi.object().keys({ a: Joi.string().allow(''), b: Joi.string().allow('').when('a', { is: '', then: Joi.string() }) }).or('a', 'b');