Joi.any().when is not evaluated it its value is empty even if the when condition is fulfilled.
For example:
Joi.object({
a: Joi.string().when('b', {is: true, then: Joi.required()}),
b: Joi.boolean().default(false)
})
If you use this object to validate {b: true} the returned value will remain {b: true} but it actually should return an error.