For example I want to validate Segments.BODY depending on a value defined in SEGMENTS query, but I can't seem to find a solution with celebrate. I don't understand why tough, would this mean bad practice?
[Segments.BODY]: (value, helpers) => {
// do some conditional validation based on the query params
return Joi.object()
.keys({
name: Joi.string().alphanum().min(2).max(30).required(),
email: Joi.string().required().email(),
})
.validate(value, joiConfig);
},