Describes a hierarchy of errors after validation has failed. The error object will have the same structure as the object being validated, e.g. each key in the error will have a corresponding key in the validated object.

Example

{
"name": ["Length can not be more than 15", "Contains invalid characters"],
"address": {
"city": ["City does not exist"],
"zipcode": ["Invalid zipcode"]
}
}

Hierarchy

  • ValidationError

Indexable

[key: string]: string[] | ValidationError