Skip to main content

ErrorViewModel

Describes an error that occurred with the request. This will typically need to be rectified before the request can be fully processed.

Properties

Property Type Required Description
message string true

The error message.

path string false

The path to the property on the request that the error relates to. May be omitted or empty if no specific property of the request relates to the error (it is a ‘global’ error).

code string true

The error’s machine-readable code. Can be used for further processing of the error before presenting to users. May be omitted if there is none.

detail any false

Additional detail about the error that can be used to provide more context to users. May be omitted if there is none.

Example schema

{
  "message": "Must be 50 characters or fewer.",
  "path": "person.name",
  "code": "MaximumLength",
  "detail": {
    "maxLength": 50
  }
}