I have an api that in the past developments would receive comma separated strings as valid input and used the following as the validator:
Joi.string()
But now I want to implement the same variable using array of strings as mentioned here https://github.com/glennjones/hapi-swagger/issues/119. So the new check would be:
Joi.array().items(Joi.string())
But I do not want to break the backward compatibility of the code. Is there a way to check both conditions for the variable?
I am a newbie to Joi, so any help or guidance would be appreciated. Thanks in advance.