{
  "$id": "https://schema.nfh.global/FlightSegment/v2.0",
  "x-iri": "https://schema.nfh.global/FlightSegment/v2.0",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "FlightSegment",
  "type": "object",
  "description": "A single non-stop flight operated between two airports, forming a unit of an air travel itinerary.",
  "properties": {
    "flightNumber": {
      "description": "IATA/ICAO flight number (e.g. AI101)",
      "type": "string"
    },
    "departureAirport": {
      "description": "IATA airport code of the departure airport",
      "type": "string"
    },
    "arrivalAirport": {
      "description": "IATA airport code of the arrival airport",
      "type": "string"
    },
    "departureTime": {
      "description": "Scheduled local departure date and time",
      "type": "string",
      "format": "date-time"
    },
    "arrivalTime": {
      "description": "Scheduled local arrival date and time",
      "type": "string",
      "format": "date-time"
    },
    "airline": {
      "description": "IATA airline code of the operating carrier",
      "type": "string"
    },
    "aircraftType": {
      "description": "IATA aircraft type code",
      "type": "string"
    },
    "mode": {
      "description": "Transport mode for this leg (e.g. BUS, RAIL, WALK, BICYCLE)",
      "type": "string"
    },
    "origin": {
      "description": "Start location of the leg",
      "$ref": "https://schema.nfh.global/Location/v2.0/schema.json"
    },
    "destination": {
      "description": "End location of the leg",
      "$ref": "https://schema.nfh.global/Location/v2.0/schema.json"
    },
    "startTime": {
      "description": "Scheduled or actual start time of the leg",
      "type": "string",
      "format": "date-time"
    },
    "endTime": {
      "description": "Scheduled or actual end time of the leg",
      "type": "string",
      "format": "date-time"
    },
    "distance": {
      "description": "Distance of this leg in metres",
      "type": "number"
    },
    "headsign": {
      "description": "Destination sign text displayed on the vehicle",
      "type": "string"
    },
    "routeRef": {
      "description": "Reference to the route served on this leg",
      "$ref": "https://schema.nfh.global/Route/v2.0/schema.json"
    }
  },
  "additionalProperties": false,
  "x-tags": [
    "mobility",
    "schema-org",
    "ride-hailing"
  ]
}
