I have a schema that looks like this:
{
a: joi.boolean(),
b: joi.object(),
c: joi.object()
}
Depending upon the value of field a = false, I want fields b or c to exist. If a is false, I want a xor condition on fields b and c.
I tried using when but I'm unable to find a perfect solution.