-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
supportQuestions, discussions, and general supportQuestions, discussions, and general support
Description
On v6.0.8, for object arrays, the stripUnknown option does not result in errors when the validation for one of the object keys fails, like the following example:
var Joi = require('joi');
var schema = Joi.array().items(Joi.object().keys({
one: Joi.string(),
two: Joi.number()
})).options({ stripUnknown: true });
schema.validate([{ one: 'one', two: 'two' }], function (err, value) {
console.log('err:', err);
console.log('value:', value);
});Is this the expected behaviour or is it a bug? I don't recall this happening on previous versions. If it's a bug, I'll gladly send a pull request.
Thanks!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
supportQuestions, discussions, and general supportQuestions, discussions, and general support