Nice article taking advantage of the clean validation of Joi. I’m just wondering what if your validation becomes complex? Complex mean, that the value of b is validated by the value of a?
Let’s say you are building out a registration form. You have the basic fields (name, age, phone number).
What if you want to validate for the phone number ONLY if the age is less than 18 years old? If the age is lower than 18, phone number is required else not required. Haven’t looked into the documentation. Any thoughts I missed?