Well, i have the following Joi object, im trying to use Or method, as you see i have two objects contains phone i wanted to use Or method but i got failed
body: Joi.object().keys({
member: Joi.object().required().keys({
id: Joi.string().required(),
phone: Joi.string().max(30),
email: Joi.string().required().max(255)
}),
billingAddress: Joi.object().keys({
line1: Joi.string().required(),
line2: Joi.string().max(60),
city: Joi.string().required().max(50),
state: Jio.required(),
postalCode: Joi.string().required(),
phone: Joi.string().max(15)
})
}).or('member.phone','billingAddress.phone')
what im trying to do is i need a phone either to be in member.phone or in billingAddress.phone at least one of them is exist the code above is not working What should i do ?