{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/mobilitydata/json-schema/mobilitydata-gtfs-feed-download-debug-response-schema.json",
  "title": "GtfsFeedDownloadDebugResponse",
  "description": "Request and response detail of a single feed download attempt. Credential values in headers and URLs are replaced with a redaction marker.\n",
  "x-generated": "2026-11-16",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/operationsapi.yaml#/components/schemas/GtfsFeedDownloadDebugResponse",
  "x-operation": true,
  "type": "object",
  "required": [
    "feed_id",
    "producer_url",
    "success"
  ],
  "properties": {
    "feed_id": {
      "type": "string",
      "description": "Stable identifier of the GTFS feed."
    },
    "producer_url": {
      "type": "string",
      "description": "Feed URL that was requested, with credentials redacted."
    },
    "resolved_url": {
      "type": [
        "string",
        "null"
      ],
      "description": "URL actually requested after credentials were applied, with credentials redacted."
    },
    "success": {
      "type": "boolean",
      "description": "Whether the download returned a 2xx response."
    },
    "status_code": {
      "type": [
        "integer",
        "null"
      ],
      "description": "HTTP status code of the final response."
    },
    "latency_ms": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Time to first response, in milliseconds."
    },
    "request_headers": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": {
        "type": "string"
      },
      "description": "Headers sent with the request, with credential values redacted."
    },
    "response_headers": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": {
        "type": "string"
      },
      "description": "Headers returned by the server, with credential values redacted."
    },
    "redirect_urls": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "string"
      },
      "description": "URLs the request was redirected through."
    },
    "external_ip": {
      "type": [
        "string",
        "null"
      ],
      "description": "Egress IP address observed for the request, when it could be determined."
    },
    "content_type": {
      "type": [
        "string",
        "null"
      ],
      "description": "Normalised Content-Type of the response."
    },
    "is_zip": {
      "type": [
        "boolean",
        "null"
      ],
      "description": "Whether the downloaded content is a ZIP file."
    },
    "downloaded_bytes": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Number of bytes read before the download completed or hit the byte cap."
    },
    "truncated": {
      "type": "boolean",
      "description": "Whether the download stopped before the end of the file, at the byte cap or the time limit."
    },
    "stop_reason": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "max_bytes",
        "deadline"
      ],
      "description": "Why reading stopped before the end of the file: `max_bytes` when the requested byte cap was reached, `deadline` when the 480 second endpoint limit was. Null when the whole file was read.\n"
    },
    "duration_ms": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Time from sending the request to the last byte read, in milliseconds."
    },
    "error_type": {
      "type": [
        "string",
        "null"
      ],
      "description": "Machine-readable error category when the download failed."
    },
    "error_message": {
      "type": [
        "string",
        "null"
      ],
      "description": "Error detail when the download failed, with credentials redacted."
    }
  }
}