Closed nlundquist closed 3 years ago
The goal of this feature is validating an object against a base object schema ( foo ) and a set of alternative objects ( bar, baz ). This sort of comparison will fail unless additionalProperties: true
is included in all the objects, this differs from typical JSONSchema due to the issue here: https://github.com/tlivings/enjoi/issues/103
For that reason I'll be resolving #103 as well in the PR for this issue.
Enjoi doesn't attempt to create Joi validators for valid schemas like:
It will only create the validator for the base object including the
foo
property. It ignores the additional mutually exclusive properties expressed in theoneOf
.Invalid data like
{ foo: 'a', bar: 'b', baz: 'c' }
passes the validator returned.