{
  "$id": "https://schema.nfh.global/Leg/v2.0",
  "x-iri": "https://schema.nfh.global/Leg/v2.0",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Leg",
  "type": "object",
  "description": "A single uninterrupted segment of a journey made using one transport mode or service between two consecutive locations.",
  "properties": {
    "mode": {
      "description": "Mode of fulfillment",
      "$ref": "https://schema.nfh.global/FulfillmentMode/v2.0/schema.json"
    },
    "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"
    },
    "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/schema.json"
    },
    "participants": {
      "description": "Participants entitled to receive this fulfillment",
      "$ref": "https://schema.nfh.global/Participant/v2.0/schema.json"
    },
    "stages": {
      "description": "Stages in the fulfillment lifecycle",
      "$ref": "https://schema.nfh.global/FulfillmentStage/v2.0/schema.json"
    },
    "instructions": {
      "description": "Instructions for fulfillment",
      "$ref": "https://schema.nfh.global/Descriptor/v2.1/schema.json"
    }
  },
  "additionalProperties": false,
  "x-tags": [
    "mobility",
    "schema-org",
    "ride-hailing"
  ]
}
