-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
featureNew functionality or improvementNew functionality or improvement
Milestone
Description
Currently, Joi only allows validating the unknown keys of an object using a regexp. While a good solution, it does adapt to more complex use-cases that would be better served by a Joi object.
For example, for email or uuid-like keys, I need to put a regex. This is sad as native validation already exists in Joi for these use-cases.
I would propose accepting as first argument a Joi string validator, while keeping the current behavior for compatibility.
The result would be: Joi.object().pattern(Joi.string().email(), Joi.any())
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
featureNew functionality or improvementNew functionality or improvement