I have something like this:
let someCoolString = 'mememe';
const schema = Joi.object({
someFieldName: Joi.string()
.when(someCoolString, {
is: "mememe",
then: Joi.required(),
otherwise: Joi.forbidden(),
})
});
But this obviously doesn't work, as someCoolString is not the Joi.object's property. Any idea of how to check for it?