My array can have multiple types:
[Joi.string(), Joi.number(), Joi.boolean(), Joi.array(), Joi.object()]
But I want to allow only one of them in the same time.
I tried the following:
attributes: Joi.object().pattern(/\w+/, Joi.alternatives().try([Joi.array().items(Joi.string()), Joi.array().items(Joi.number()), Joi.array().items(Joi.boolean()), Joi.array().items(Joi.array()), Joi.array().items(Joi.object())]))
I'm using Joi 11.4.0. I know it is an old version, but is there any way to perform such a validation? Does it doable in another version?