最佳答案
Is there any other way to set specific values in Joi validation schema for key except regex pattern?
My example schema:
const schema = joi.object().keys({
query: joi.object().keys({
// allow only apple and banana
id: joi.string().regex(/^(apple|banana)$/).required(),
}).required(),
})