You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The text was updated successfully, but these errors were encountered:
try {
var value = values[paramName];
} catch (e) {
var value = undefined;
}
It has resolved all my issues with this bug. Probably not the right way to fix it but it worked for my use case. I don't use node often so someone may want to fully vet any unforeseen by products of it.
Validation nesting schemas throws an error if
Composite Schema
Validation
the object I'm passing to
validate
method doesn't have keyuser
. And sinceuser
not mandatory I expect validation to pass, but instead it throwsError: Cannot read property 'email' of undefined
Is it expecting behaviour?
The text was updated successfully, but these errors were encountered: