Using Joi, require one of two fields to be non empty
Code below worked for me. I used alternatives because .or is really testing for the existence of keys and what you really wanted was an alternative where you would allow one key or the other to be empty. var console = require(“consoleit”); var Joi = require(‘joi’); var schema = Joi.alternatives().try( Joi.object().keys({ a: Joi.string().allow(”), b: Joi.string() … Read more