openapi: 3.1.0
info:
  title: Leg
  version: 2.0.0
  description: Schema definition for the Leg entity in the Beckn Mobility domain.
  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:
    Leg:
      x-iri: https://schema.nfh.global/Leg/v2.0
      type: object
      title: Leg
      description: A single uninterrupted segment of a journey made using one transport
        mode or service between two consecutive locations.
      x-tags:
        - mobility
        - schema-org
        - ride-hailing
      properties:
        mode:
          description: Mode of fulfillment
          $ref: https://schema.nfh.global/FulfillmentMode/v2.0/attributes.yaml#/components/schemas/FulfillmentMode
        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
        id:
          description: Unique identifier for the fulfillment
          type: string
        type:
          description: Type of fulfillment (extensible term)
          type: string
        agent:
          description: The entity responsible for performing the fulfillment
          $ref: https://schema.nfh.global/FulfillmentAgent/v2.0/attributes.yaml#/components/schemas/FulfillmentAgent
        participants:
          description: Participants entitled to receive this fulfillment
          $ref: https://schema.nfh.global/Participant/v2.0/attributes.yaml#/components/schemas/Participant
        stages:
          description: Stages in the fulfillment lifecycle
          $ref: https://schema.nfh.global/FulfillmentStage/v2.0/attributes.yaml#/components/schemas/FulfillmentStage
        instructions:
          description: Instructions for fulfillment
          $ref: https://schema.nfh.global/Descriptor/v2.0/attributes.yaml#/components/schemas/Descriptor
      additionalProperties: false
