Open
Description
Validation nesting schemas throws an error if
Composite Schema
const user = schema({
email: String
});
const querySchema = schema({
user,
startDate: Date,
endDate: Date
});
Validation
await querySchema.validate({
startDate: (new Date())
});
the object I'm passing to validate
method doesn't have key user
. And since user
not mandatory I expect validation to pass, but instead it throws Error: Cannot read property 'email' of undefined
Is it expecting behaviour?