openapi: 3.1.0
info:
  title: FlightSegment
  version: 2.0.0
  description: Schema definition for the FlightSegment entity in the Beckn Mobility
  license:
    name: CC-BY-NC-SA 4.0 International
    url: https://creativecommons.org/licenses/by-nc-sa/4.0/deed.en
  contact:
    name: Beckn Labs
    url: https://beckn.io
components:
  schemas:
    FlightSegment:
      x-iri: https://schema.nfh.global/FlightSegment/v2.0
      type: object
      title: FlightSegment
      description: A single non-stop flight operated between two airports, forming
        a unit of an air travel itinerary.
      x-tags:
        - mobility
        - schema-org
        - ride-hailing
      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/attributes.yaml#/components/schemas/Location
        destination:
          description: End location of the leg
          $ref: https://schema.nfh.global/Location/v2.0/attributes.yaml#/components/schemas/Location
        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/attributes.yaml#/components/schemas/Route
      additionalProperties: false
