-
-
Notifications
You must be signed in to change notification settings - Fork 1
Message
Alan Berdinelli edited this page Feb 13, 2024
·
5 revisions
Added in v3.3.1
You can add a custom message when the validation fails without the need for a custom validator function.
const schema = new Schemy({
name: {
type: String,
required: true,
message: 'Please tell me your name.'
}
});
schema.validate({});
schema.getValidationErrors(); // => ['Please tell me your name']Developed with ♥ by Alan Berdinelli.