Joi.object().keys({
myObject: Joi.array().items(Joi.object().keys({
key: Joi.string().valid('fristName','lastName'),
value: Joi.any().required(),
})),
});
Here I want must required 'firstName' and 'lastName' but other will also allowed.
CodePudding user response:
I don't know your context, but i think thats it should help you. .unknown() method
CodePudding user response:
You can otherwise with validation refer otherwise api to solve it.