openapi: 3.1.0
info:
  title: ItineraryElement
  version: 2.0.0
  description: Schema definition for the ItineraryElement 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:
    ItineraryElement:
      x-iri: https://schema.nfh.global/ItineraryElement/v2.0
      type: object
      title: ItineraryElement
      description: A component of an aviation itinerary such as a flight segment,
        ground transport leg, or ancillary service.
      x-tags:
        - mobility
        - ride-hailing
      properties:
        elementType:
          description: Type of itinerary element (FLIGHT, GROUND_TRANSPORT, ANCILLARY)
          type: string
        segmentRef:
          description: Reference to a flight segment if this is a flight element
          $ref: https://schema.nfh.global/FlightSegment/v2.0/attributes.yaml#/components/schemas/FlightSegment
        legRef:
          description: Reference to a transport leg if this is a surface element
          $ref: https://schema.nfh.global/Leg/v2.0/attributes.yaml#/components/schemas/Leg
        sequence:
          description: Sequential order of this element within the itinerary
          type: number
        id:
          description: Unique identifier for the contract item
          type: string
        descriptor:
          description: Human-readable description of the item
          $ref: https://schema.nfh.global/Descriptor/v2.0/attributes.yaml#/components/schemas/Descriptor
        price:
          description: Price for this contract item
          $ref: https://schema.nfh.global/PriceSpecification/v2.1/attributes.yaml#/components/schemas/PriceSpecification
        quantity:
          description: Quantity of this contract item
          $ref: https://schema.nfh.global/Quantity/v2.0/attributes.yaml#/components/schemas/Quantity
      additionalProperties: false
