Error Catalog API uses error.json and error_instance.json for error response.
Schema used for error response is derived from Problem Details JSON Object as described in RFC 7807. Following sections describe individual members of error.json
and error_instance.json
. We also describe below where we have extended the Problem Details JSON Object and where we have diverged from it and why.
type: string, uri, required
A URI reference RFC3986 that identifies the problem type, as defined in RFC 7807. This specification encourages that, when dereferenced, it provides human-readable documentation for the problem type (e.g., using HTML W3C.REC-html5-20141028). When this member is not present, its value is assumed to be "about:blank".
type: string, optional
A short, human-readable summary of the problem type, as defined in RFC 7807. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see RFC7231, Section 3.4).
type: number, optional
The HTTP status code RFC7231, Section 6) generated by the origin server for an occurrence of the problem, as defined in RFC 7807.
type: string, optional
A human-readable explanation specific to an occurrence of the problem, as defined in RFC 7807.
type: string, optional
A unique reference for the problem instance for correlation purposes. This is an extension to the Problem Details JSON Object of RFC 7807.
type: array, optional
Links providing more information related to problem. This is an extension to the Problem Details JSON Object of RFC 7807. These links could point to FAQ or support pages providing help in order to resolve error situations.
type: string, optional
A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.
We do not use this member of the Problem Details JSON Object of RFC7807. Instead, we use instances
array as described below.
type: array, optional
We have used an array of error instances
since 400
Bad Request
types of status would require reporting more than one instances of the same problem type in an error response. Using the JSON type of array
also works in cases where a single instance of a problem type is reported in the error response. This is an extension to the Problem Details JSON Object of RFC 7807.
Following section describes the schema for an array element of instances
.
Schema for error_instance.json is derived from standard validation output format as defined in section 10 of JSON Schema specification.
type: string, optional
Location of keyword entity involved in error. If the keyword is in the body, this will be JSON pointer to the property.
type: string, optional
The location of the error instance if qualification is needed beyond the keyword_location
. Could be used to provide index of entry in array.
type: string, optional
The value of the keyword entity in error, if available.
type: string, required
The location of the type of entity that is in error. Valid values are body
, path
, or query
. Default is body
.
type: string, required
Error message for entity in error. It is recommended that this value is not hardcoded but instead injected from relevant entry (with template string) in the error catalog.
type: string, uri, optional
A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced. This member is from RFC 7807 but it is moved to an entity in array of instances
.