What will be the validation of the following schema using Joi validation? How do we validate nested objects and arrays?
const user = {
address: {
contactName: 'Sunny',
detailAddress: {
line1: 'Sector: 2/A',
line2: 'Q. No.: 3-018',
line3: 'Near Shopping Centre'
},
pin: 827001,
country: 'India'
},
cart: [
{
id: 'newId',
count: 2
}
]
};