{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/transit/json-schema/transit-itinerary-schema.json",
  "title": "Itinerary",
  "x-generated": "2026-11-09",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/transit-trip-planning-api-openapi.yml#/components/schemas/Itinerary",
  "type": "object",
  "properties": {
    "duration": {
      "type": "integer",
      "description": "Total trip duration in seconds."
    },
    "start_time": {
      "type": "integer",
      "description": "Unix epoch seconds of departure."
    },
    "end_time": {
      "type": "integer",
      "description": "Unix epoch seconds of arrival."
    },
    "legs": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Leg"
      }
    }
  },
  "$defs": {
    "Leg": {
      "type": "object",
      "properties": {
        "mode": {
          "type": "string"
        },
        "from": {
          "type": "string"
        },
        "to": {
          "type": "string"
        },
        "route_short_name": {
          "type": "string"
        },
        "duration": {
          "type": "integer"
        }
      }
    }
  }
}