{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/adsbiq-com/json-schema/adsbiq-com-route-activity-schema.json",
  "title": "RouteActivity",
  "x-generated": "2026-10-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/adsbiq-com-openapi.yaml#/components/schemas/RouteActivity",
  "type": "object",
  "required": [
    "now",
    "origin",
    "destination",
    "ac",
    "total"
  ],
  "properties": {
    "now": {
      "type": "number"
    },
    "origin": {
      "$ref": "#/$defs/Airport"
    },
    "destination": {
      "$ref": "#/$defs/Airport"
    },
    "ac": {
      "type": "array",
      "maxItems": 500,
      "items": {
        "$ref": "#/$defs/Aircraft"
      }
    },
    "total": {
      "type": "integer",
      "minimum": 0,
      "maximum": 500
    }
  },
  "$defs": {
    "Aircraft": {
      "type": "object",
      "required": [
        "hex"
      ],
      "additionalProperties": true,
      "properties": {
        "hex": {
          "type": "string",
          "pattern": "^[~0-9a-f]{1,7}$"
        },
        "flight": {
          "type": "string"
        },
        "r": {
          "type": "string",
          "description": "Registration"
        },
        "t": {
          "type": "string",
          "description": "ICAO aircraft type"
        },
        "lat": {
          "type": "number",
          "minimum": -90,
          "maximum": 90
        },
        "lon": {
          "type": "number",
          "minimum": -180,
          "maximum": 180
        },
        "alt_baro": {
          "oneOf": [
            {
              "type": "number"
            },
            {
              "type": "string",
              "enum": [
                "ground"
              ]
            }
          ]
        },
        "alt_geom": {
          "type": "number"
        },
        "gs": {
          "type": "number",
          "minimum": 0
        },
        "track": {
          "type": "number",
          "minimum": 0,
          "maximum": 360
        },
        "squawk": {
          "type": "string",
          "pattern": "^[0-7]{4}$"
        },
        "emergency": {
          "type": "string"
        },
        "route_origin": {
          "type": "string"
        },
        "route_dest": {
          "type": "string"
        },
        "seen": {
          "type": "number",
          "minimum": 0
        },
        "origin_airport": {
          "$ref": "#/$defs/Airport"
        },
        "destination_airport": {
          "$ref": "#/$defs/Airport"
        }
      }
    },
    "Airport": {
      "type": "object",
      "required": [
        "icao",
        "name",
        "lat",
        "lon"
      ],
      "properties": {
        "icao": {
          "type": "string"
        },
        "iata": {
          "type": [
            "string",
            "null"
          ]
        },
        "local": {
          "type": [
            "string",
            "null"
          ]
        },
        "name": {
          "type": "string"
        },
        "city": {
          "type": [
            "string",
            "null"
          ]
        },
        "country": {
          "type": [
            "string",
            "null"
          ]
        },
        "type": {
          "type": [
            "string",
            "null"
          ]
        },
        "lat": {
          "type": "number"
        },
        "lon": {
          "type": "number"
        },
        "distance_nm": {
          "type": "number",
          "minimum": 0
        }
      }
    }
  }
}