{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/thinair-co/json-schema/thinair-co-traffic-response-schema.json",
  "title": "TrafficResponse",
  "description": "Pass-through of the typed TrafficResult. `coverage: false` means no live data was returned; `coverage_reason` names the cause when it is known to be something other than the location (`disabled`, `unavailable`) and is absent for a genuine coverage gap.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/thinair-co-conditions-api-openapi.yml#/components/schemas/TrafficResponse",
  "type": "object",
  "properties": {
    "lat": {
      "type": "number"
    },
    "lon": {
      "type": "number"
    },
    "coverage": {
      "type": "boolean"
    },
    "coverage_reason": {
      "type": "string",
      "enum": [
        "disabled",
        "unavailable"
      ]
    },
    "current_speed": {
      "type": [
        "number",
        "null"
      ]
    },
    "free_flow_speed": {
      "type": [
        "number",
        "null"
      ]
    },
    "ratio_pct": {
      "type": [
        "number",
        "null"
      ]
    },
    "units": {
      "type": "string"
    },
    "segments": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": {}
      }
    },
    "segment_count": {
      "type": "number"
    },
    "closures": {
      "type": "number"
    },
    "congestion": {
      "type": "string"
    },
    "meta": {
      "type": "object",
      "properties": {
        "upstream_ms": {
          "type": "number"
        },
        "feature_count": {
          "type": "number"
        },
        "cacheHit": {
          "type": "boolean"
        }
      },
      "required": [
        "upstream_ms",
        "feature_count"
      ]
    },
    "upstream_error": {
      "type": [
        "string",
        "null"
      ]
    }
  },
  "required": [
    "lat",
    "lon",
    "current_speed",
    "free_flow_speed",
    "ratio_pct",
    "units",
    "segments",
    "segment_count",
    "closures",
    "congestion",
    "meta"
  ]
}