{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/openpo-st/json-schema/openpo-st-ingest-diagnostics-input-body-schema.json",
  "title": "IngestDiagnosticsInputBody",
  "x-generated": "2026-11-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/openpo-st-openapi.json#/components/schemas/IngestDiagnosticsInputBody",
  "additionalProperties": false,
  "properties": {
    "$schema": {
      "description": "A URL to the JSON Schema for this object.",
      "format": "uri",
      "readOnly": true,
      "type": "string"
    },
    "attempt_count": {
      "description": "Attempt count, when relevant",
      "format": "int64",
      "maximum": 1000000,
      "minimum": 0,
      "type": "integer"
    },
    "db_driver": {
      "description": "Normalized database driver",
      "maxLength": 16,
      "type": "string"
    },
    "error_code": {
      "description": "Normalized error code from the diagnostics catalog",
      "maxLength": 64,
      "type": "string"
    },
    "error_kind": {
      "description": "Allowlisted error type, never message text",
      "enum": [
        "deadline_exceeded",
        "canceled",
        "not_found",
        "permission_denied",
        "connection_refused",
        "connection_reset",
        "unexpected_eof",
        "dns_error",
        "network_timeout",
        "runtime_error",
        "type_error",
        "reference_error",
        "range_error",
        "syntax_error",
        "quota_exceeded",
        "security_error",
        "not_supported",
        "invalid_state",
        "abort_error",
        "network_error"
      ],
      "type": "string"
    },
    "first_seen": {
      "description": "RFC3339 first observation, when known",
      "maxLength": 32,
      "type": "string"
    },
    "frames": {
      "description": "Sanitized stack frames without domains or local paths",
      "items": {
        "$ref": "#/$defs/DiagnosticsFrame"
      },
      "maxItems": 24,
      "type": [
        "array",
        "null"
      ]
    },
    "http_method": {
      "description": "HTTP request method, when relevant",
      "enum": [
        "GET",
        "HEAD",
        "POST",
        "PUT",
        "PATCH",
        "DELETE",
        "OPTIONS",
        "CONNECT",
        "TRACE"
      ],
      "type": "string"
    },
    "http_status": {
      "description": "HTTP status, when relevant",
      "format": "int64",
      "maximum": 599,
      "minimum": 0,
      "type": "integer"
    },
    "installation_id": {
      "description": "Random installation ID generated by the sending instance",
      "maxLength": 64,
      "type": "string"
    },
    "last_seen": {
      "description": "RFC3339 last observation, when known",
      "maxLength": 32,
      "type": "string"
    },
    "occurrence_count": {
      "description": "Aggregated occurrence count",
      "format": "int64",
      "maximum": 1000000,
      "minimum": 0,
      "type": "integer"
    },
    "operation": {
      "description": "Route template, job type, or operation name",
      "maxLength": 160,
      "type": "string"
    },
    "provider": {
      "description": "First-party platform, when relevant",
      "maxLength": 32,
      "type": "string"
    },
    "retry_count": {
      "description": "Retry count, when relevant",
      "format": "int64",
      "maximum": 1000000,
      "minimum": 0,
      "type": "integer"
    },
    "revision": {
      "description": "OpenPost source revision reported by the sending instance",
      "maxLength": 128,
      "type": "string"
    },
    "storage_driver": {
      "description": "Normalized media storage driver",
      "maxLength": 16,
      "type": "string"
    },
    "surface": {
      "description": "Surface where the failure was observed",
      "enum": [
        "browser",
        "backend",
        "worker"
      ],
      "type": "string"
    },
    "version": {
      "description": "OpenPost release reported by the sending instance",
      "maxLength": 64,
      "type": "string"
    }
  },
  "required": [
    "installation_id",
    "version",
    "revision",
    "surface",
    "operation",
    "error_code"
  ],
  "type": "object",
  "$defs": {
    "DiagnosticsFrame": {
      "additionalProperties": false,
      "properties": {
        "column": {
          "description": "Source column, when available",
          "format": "int64",
          "maximum": 1073741824,
          "minimum": 0,
          "type": "integer"
        },
        "function": {
          "description": "Function name",
          "maxLength": 160,
          "type": "string"
        },
        "line": {
          "description": "Source line",
          "format": "int64",
          "minimum": 0,
          "type": "integer"
        },
        "module": {
          "description": "Normalized module path and file, never a URL or domain",
          "maxLength": 240,
          "type": "string"
        }
      },
      "required": [
        "module",
        "function",
        "line"
      ],
      "type": "object"
    }
  }
}