Choose what this site may use

This site uses strictly necessary cookies to work and to remember your privacy choices. With your permission it would also load content hosted by other services, such as videos, maps and fonts, which then receive your network address and device data. We do not sell or share your personal information and we run no advertising. Choose Accept all, Reject all or Customise. You can change your mind at any time through Privacy choices at the foot of every page.

  • Always on

    Needed for the site to work and to remember your privacy choices. Always on.

  • Remembers settings you choose, such as the light or dark display, in your browser.

  • Loads videos, maps and other content hosted by other services. Those services receive your address and device data.

Menu Close
In this section: Specification
Specification
Functions
Schemas
Registers

ErrorProblem

Source schemas/json/error-problem.schema.json

On this page
  1. Properties
  2. Positive fixtures
  3. Negative fixtures
  4. Mappings to open standards
  5. Schema

Canonical RFC 7807-shaped Observatory problem contract with bounded diagnostic disclosure.

FieldValue
Identifierurn:obsp:schema:v3.1:errorproblem
Dialecthttps://json-schema.org/draft/2020-12/schema
Used by functionsnone

Properties

PropertyRequiredTypeDescription
schemaVersionyesreference
errorIdyesstring
typeyesstring
titleyesreference
statusyesinteger
detailyesreference
instanceyesstring
errorCodeyesstring
categoryyesenumeration
correlationIdyesstring
requestIdnostring
retryableyesboolean
retryAfterSecondsnointeger
policyDecisionRefnostring
evidenceRefnoreference
violationsnoarray
extensionsnoreference

Positive fixtures

  • error-problem.valid.json

Negative fixtures

  • error-problem.bad-code.json: required at /: 'errorId' is a required property

Mappings to open standards

A mapping to a standard, never a conformance statement.

  • maps to RFC 9457 (problem details for HTTP APIs) (relation EXT-RFC9457)

Schema

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "urn:obsp:schema:v3.1:errorproblem",
  "title": "ErrorProblem",
  "description": "Canonical RFC 7807-shaped Observatory problem contract with bounded diagnostic disclosure.",
  "type": "object",
  "required": [
    "schemaVersion",
    "errorId",
    "type",
    "title",
    "status",
    "detail",
    "instance",
    "errorCode",
    "category",
    "correlationId",
    "retryable"
  ],
  "properties": {
    "schemaVersion": {
      "$ref": "#/$defs/SchemaVersion"
    },
    "errorId": {
      "type": "string",
      "minLength": 8,
      "maxLength": 128
    },
    "type": {
      "type": "string",
      "format": "uri"
    },
    "title": {
      "$ref": "#/$defs/NonEmptyString"
    },
    "status": {
      "type": "integer",
      "minimum": 400,
      "maximum": 599
    },
    "detail": {
      "$ref": "#/$defs/NonEmptyString"
    },
    "instance": {
      "type": "string",
      "minLength": 1,
      "maxLength": 2048
    },
    "errorCode": {
      "type": "string",
      "pattern": "^OBS-[A-Z0-9]+-[0-9]{4}$"
    },
    "category": {
      "enum": [
        "VALIDATION",
        "AUTHENTICATION",
        "AUTHORIZATION",
        "POLICY_DENIED",
        "NOT_FOUND",
        "CONFLICT",
        "VERSION_CONFLICT",
        "IDEMPOTENCY_CONFLICT",
        "RATE_LIMITED",
        "DEPENDENCY_UNAVAILABLE",
        "DEGRADED",
        "STALE",
        "INSUFFICIENT_EVIDENCE",
        "UNSUPPORTED_CAPABILITY",
        "PROVIDER_ERROR",
        "INTERNAL"
      ]
    },
    "correlationId": {
      "type": "string",
      "minLength": 8,
      "maxLength": 128
    },
    "requestId": {
      "type": "string",
      "minLength": 8,
      "maxLength": 128
    },
    "retryable": {
      "type": "boolean"
    },
    "retryAfterSeconds": {
      "type": "integer",
      "minimum": 0,
      "maximum": 86400
    },
    "policyDecisionRef": {
      "type": "string",
      "minLength": 1,
      "maxLength": 2048
    },
    "evidenceRef": {
      "$ref": "#/$defs/EvidenceRef"
    },
    "violations": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "field",
          "reason"
        ],
        "properties": {
          "field": {
            "type": "string",
            "minLength": 1,
            "maxLength": 512
          },
          "reason": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2048
          },
          "code": {
            "type": "string",
            "maxLength": 128
          }
        },
        "additionalProperties": false
      }
    },
    "extensions": {
      "$ref": "#/$defs/Extensions"
    }
  },
  "$defs": {
    "Digest": {
      "type": "string",
      "pattern": "^[a-z0-9][a-z0-9._-]{1,31}:[A-Fa-f0-9]{32,128}$"
    },
    "IsoDateTime": {
      "type": "string",
      "format": "date-time"
    },
    "NonEmptyString": {
      "type": "string",
      "minLength": 1,
      "maxLength": 2048
    },
    "EvidenceRef": {
      "type": "object",
      "required": [
        "uri",
        "digest"
      ],
      "properties": {
        "uri": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096
        },
        "digest": {
          "$ref": "#/$defs/Digest"
        },
        "kind": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "recordedAt": {
          "$ref": "#/$defs/IsoDateTime"
        }
      },
      "additionalProperties": false
    },
    "Extensions": {
      "type": "object",
      "description": "Namespaced extension bag; extension content is never trusted as canonical error semantics.",
      "propertyNames": {
        "pattern": "^[a-z][a-z0-9]*(\\.[a-z][a-z0-9]*)+$"
      },
      "additionalProperties": true
    },
    "SchemaVersion": {
      "type": "string",
      "const": "3.1.0"
    }
  },
  "additionalProperties": false
}