Closed rtxd closed 1 year ago
Hi,
The issue is both your andFilters
and orFilters
don't have a discriminatory element since neither and
nor or
are required, so those schemas would basically match any object, setting the arrays inside those schemas as required should fix your problem.
@Marsup Thanks!
Runtime
node.js
Runtime version
16.x
Module version
17.11.0
Last module version without issue
No response
Used with
standalone
Any other relevant information
input validation issue
What are you trying to achieve or the steps to reproduce?
I'm trying to create a schema using joi.array().items() that validates an array of 3 different types of items. The JOI schema seems to be stripping one of the members even though all members comply with the schema.
I've read the documentation and it says
items()
should work with one or more item typesWhat was the result you got?
andFilter was stripped from schema even though it matched
What result did you expect?