-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Description
What are you doing?
We expect to be able to return useful validation errors for our API users/UI to understand - to do so we need the field name the error is for. With custom validation errors, we get that information and can use it to highlight fields in the UI - with any core type, we get no information other than the value that failed. It would be extremely useful if all validation errors were the same, no matter if it was a core type or custom type. If you agree I can send a PR shortly since this is a pretty easy fix.
Model.validate({ id: '1234' })What do you expect to happen?
An error resembling other validation errors, complete with an errors array, each item containing validatorKey, path, value, and message.
What is actually happening?
The only information in the error is the message attribute:
"1234" is not a valid uuid
Dialect: any
Sequelize version: 5.x
Tested with latest release: Yes