{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://xcathletes.org/contract/schemas/problem.json",
  "title": "problem",
  "description": "Every /v1/ error response (ERR-01, RFC 9457 problem+json). Response schema, PRIN-04 open: the catalogue (ERR-02) grows by addition only (PRIN-02), so a type this consumer's own copy of the catalogue does not recognize falls back to treating the response as a generic error keyed on `status` alone.",
  "type": "object",
  "additionalProperties": true,
  "required": ["type", "title", "status", "request_id"],
  "properties": {
    "type": {
      "type": "string",
      "format": "uri",
      "description": "Resolves to the public error catalogue (ERR-02); an absolute origin, never the relative /docs/errors/{code} form. An unrecognized type falls back to the generic-error handling this schema's own description names."
    },
    "title": { "type": "string" },
    "status": { "type": "integer", "minimum": 400, "maximum": 599 },
    "request_id": { "type": "string", "description": "Echoed as the Request-Id response header; correlates a response with a server-side log line." },
    "detail": { "type": "string", "description": "Developer-audience explanation (ERR-03); never athlete- or coach-audience wording." },
    "errors": {
      "type": "array",
      "description": "ERR-01's multi-field validation extension.",
      "items": {
        "type": "object",
        "additionalProperties": true,
        "required": ["field", "detail"],
        "properties": {
          "field": { "type": "string" },
          "detail": { "type": "string" }
        }
      }
    }
  }
}
