{
  "openapi": "3.1.2",
  "info": {
    "title": "Open Layer REST mirror",
    "version": "0.1.0",
    "description": "Follows one flight connection through Dubai (DXB) for one traveller, with their consent, until the onward flight departs. These are the five operations of the MCP endpoint at /mcp for agents that do not speak MCP, with the same answers, plus the events of the journey by webhook and as a stream. A token stands for one journey, so no route takes a journey id. Getting the journey is the truth; an event is a hint. Concept prototype. Not affiliated with any airline or airport."
  },
  "servers": [
    {
      "url": "https://open-layer.dev"
    }
  ],
  "paths": {
    "/v0/journey": {
      "get": {
        "operationId": "get_journey",
        "summary": "Get journey",
        "description": "Call this first, and again whenever the traveller asks where to go or whether they have time, and after every update. Never reuse an earlier answer. Returns both flights, the onward gate, boarding times and the time budget. Pass `at` when you know where the traveller is now: a gate such as B26, `transfer_security_cleared`, or a place id from find_nearby.",
        "security": [
          {
            "bearer": []
          },
          {
            "oauth2": [
              "journey.read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "at",
            "in": "query",
            "required": false,
            "description": "Where the traveller is now, if you know: a gate such as B26, transfer_security_cleared, or a place id from find_nearby.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "What the MCP tool of the same name returns as structured content.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetJourneyResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidInput"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "409": {
            "$ref": "#/components/responses/NotNow"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Failed"
          }
        }
      }
    },
    "/v0/route": {
      "get": {
        "operationId": "get_route",
        "summary": "Get route",
        "description": "Call this when the traveller needs to move. Returns ordered steps with minutes at the traveller's pace. `to` defaults to the onward gate; `from` defaults to the last known position and, when given, records where the traveller is.",
        "security": [
          {
            "bearer": []
          },
          {
            "oauth2": [
              "route.read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "to",
            "in": "query",
            "required": false,
            "description": "Destination: a gate or a place id. Defaults to the onward gate.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "description": "Where the traveller is now: a gate, transfer_security_cleared, or a place id. Defaults to the last known position. When given, it is recorded as that position.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "What the MCP tool of the same name returns as structured content.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetRouteResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidInput"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "409": {
            "$ref": "#/components/responses/NotNow"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Failed"
          }
        }
      }
    },
    "/v0/nearby": {
      "get": {
        "operationId": "find_nearby",
        "summary": "Find nearby places",
        "description": "Call this when the traveller has spare time or needs something. Returns places of one category within a walking time, and whether each is on the way to the gate.",
        "security": [
          {
            "bearer": []
          },
          {
            "oauth2": [
              "route.read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "category",
            "in": "query",
            "required": true,
            "description": "What the traveller is looking for.",
            "schema": {
              "type": "string",
              "enum": [
                "quiet_seating",
                "prayer_room",
                "food",
                "water",
                "restroom",
                "pharmacy",
                "lounge"
              ]
            }
          },
          {
            "name": "within_minutes",
            "in": "query",
            "required": false,
            "description": "Longest acceptable way there in minutes, security wait included.",
            "schema": {
              "default": 15,
              "type": "integer",
              "minimum": 1,
              "maximum": 60
            }
          }
        ],
        "responses": {
          "200": {
            "description": "What the MCP tool of the same name returns as structured content.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FindNearbyResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidInput"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "409": {
            "$ref": "#/components/responses/NotNow"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Failed"
          }
        }
      }
    },
    "/v0/updates": {
      "get": {
        "operationId": "get_updates",
        "summary": "Get updates",
        "description": "Call this to catch up when you cannot receive events. Pass the cursor from get_journey or from your last get_updates. Returns what changed since then.",
        "security": [
          {
            "bearer": []
          },
          {
            "oauth2": [
              "journey.read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The cursor from get_journey or from your last get_updates. Leave it out for everything since the journey began.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "What the MCP tool of the same name returns as structured content.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetUpdatesResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidInput"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "409": {
            "$ref": "#/components/responses/NotNow"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Failed"
          }
        }
      }
    },
    "/v0/assistance": {
      "post": {
        "operationId": "request_assistance",
        "summary": "Request assistance",
        "description": "Call this only after the traveller has asked for help and confirmed. Records a request for someone at the Open Layer host desk to meet the traveller. Concept prototype: the desk belongs to this service, and no airline or airport is notified.",
        "security": [
          {
            "bearer": []
          },
          {
            "oauth2": [
              "assist.request"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RequestAssistanceInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "What the MCP tool of the same name returns as structured content.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RequestAssistanceResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidInput"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "409": {
            "$ref": "#/components/responses/NotNow"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Failed"
          }
        }
      }
    },
    "/v0/subscriptions": {
      "post": {
        "operationId": "create_subscription",
        "summary": "Subscribe a webhook",
        "description": "Has the events of the journey sent to a callback URL as signed webhooks. A callback URL that is new to the journey is verified first: it receives a signed `verification` message and must answer with the same challenge. Sending the same callback URL and events again refreshes the subscription: the secret is replaced and the lifetime granted again. A journey has at most 16 subscriptions, and they end with it.",
        "security": [
          {
            "bearer": []
          },
          {
            "oauth2": [
              "journey.read"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SubscriptionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Refreshed: the subscription existed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Subscription"
                }
              }
            }
          },
          "201": {
            "description": "Subscribed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Subscription"
                }
              }
            }
          },
          "400": {
            "description": "`invalid_input`: the body, the secret or the callback URL cannot be accepted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionError"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`forbidden`: the server runs without authentication, and webhooks need a traveller who approved them; or the journey has ended during this call.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionError"
                }
              }
            }
          },
          "422": {
            "description": "`callback_endpoint_error`: the callback URL did not pass verification. `reason` says how it failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionError"
                }
              }
            }
          },
          "429": {
            "description": "`subscription_limit`: the journey has as many subscriptions as it may. `rate_limited`: too many verifications or requests.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionError"
                }
              }
            }
          }
        },
        "callbacks": {
          "delivery": {
            "{$request.body#/callback_url}": {
              "$ref": "#/components/pathItems/Delivery"
            }
          }
        }
      },
      "get": {
        "operationId": "list_subscriptions",
        "summary": "List subscriptions",
        "description": "The webhook subscriptions of the journey. A secret is never returned.",
        "security": [
          {
            "bearer": []
          },
          {
            "oauth2": [
              "journey.read"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "The subscriptions, with how delivery is going.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`forbidden`: the server runs without authentication, and webhooks need a traveller who approved them.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionError"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v0/subscriptions/{id}": {
      "delete": {
        "operationId": "delete_subscription",
        "summary": "Unsubscribe",
        "description": "Ends a subscription and drops what was still waiting to be sent to it.",
        "security": [
          {
            "bearer": []
          },
          {
            "oauth2": [
              "journey.read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Unsubscribed."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`forbidden`: the server runs without authentication, and webhooks need a traveller who approved them.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionError"
                }
              }
            }
          },
          "404": {
            "description": "This journey has no such subscription."
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v0/stream": {
      "get": {
        "operationId": "stream_events",
        "summary": "Stream events",
        "description": "The events of the journey as Server-Sent Events, each as it happens. The stream starts after the position in `Last-Event-ID`, else after `cursor`, else now. A comment line keeps the connection alive every 15 seconds. The stream is closed after 10 minutes: reconnect with `Last-Event-ID`. A journey has at most 4 streams, and a fifth closes the oldest. The token goes in the `Authorization` header and is never read from the query string, so the `EventSource` of a browser cannot be used as it is. A stream is a hint: after a gap, or when in doubt, get the journey.",
        "security": [
          {
            "bearer": []
          },
          {
            "oauth2": [
              "journey.read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "A cursor from the journey, from the updates or from an earlier frame.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Last-Event-ID",
            "in": "header",
            "required": false,
            "description": "The id of the last frame seen. It wins over `cursor`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The stream.",
            "content": {
              "text/event-stream": {
                "schema": {
                  "type": "string",
                  "description": "Frames of `id`, `event` and `data`, where `data` is one line of JSON."
                },
                "x-oai-itemSchema": {
                  "type": "object",
                  "required": [
                    "event",
                    "data"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "A cursor. Send the last one seen as Last-Event-ID to resume after it."
                    },
                    "event": {
                      "type": "string"
                    },
                    "data": {
                      "type": "string",
                      "contentMediaType": "application/json"
                    }
                  },
                  "oneOf": [
                    {
                      "description": "An event of the journey.",
                      "properties": {
                        "event": {
                          "enum": [
                            "journey.flight.updated",
                            "journey.gate.assigned",
                            "journey.gate.changed",
                            "journey.boarding.opened",
                            "journey.time_budget.changed",
                            "journey.assist.updated",
                            "journey.offer.published",
                            "journey.ended"
                          ]
                        },
                        "data": {
                          "contentSchema": {
                            "$ref": "#/components/schemas/JourneyEvent"
                          }
                        }
                      }
                    },
                    {
                      "description": "The first frame when the position that was given cannot be used.",
                      "properties": {
                        "event": {
                          "const": "gap"
                        },
                        "data": {
                          "contentSchema": {
                            "$ref": "#/components/schemas/StreamGap"
                          }
                        }
                      }
                    },
                    {
                      "description": "The last frame: the journey ended.",
                      "properties": {
                        "event": {
                          "const": "terminated"
                        },
                        "data": {
                          "contentSchema": {
                            "$ref": "#/components/schemas/StreamTerminated"
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Failed"
          }
        }
      }
    },
    "/v0/pair": {
      "post": {
        "operationId": "pair",
        "summary": "Exchange a pairing code",
        "description": "For an agent that cannot follow a browser redirect: exchanges the pairing code the traveller was shown after consent for the access token of the journey. It answers what the token endpoint answers for the pairing grant, and needs no token.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PairRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The access token of the journey. Never cached.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Token"
                }
              }
            }
          },
          "400": {
            "description": "`invalid_request`: no pairing code was sent. `invalid_grant`: the code is unknown, expired or used.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthError"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`: too many attempts from this address.",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "webhooks": {
    "delivery": {
      "$ref": "#/components/pathItems/Delivery"
    }
  },
  "components": {
    "schemas": {
      "RequestAssistanceInput": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "enum": [
              "MAAS",
              "WCHR",
              "WCHS",
              "WCHC",
              "BLND",
              "DEAF",
              "DPNA"
            ],
            "description": "IATA special service code. MAAS: meet and assist. WCHR: wheelchair for the distance, can manage steps. WCHS: wheelchair, cannot manage steps. WCHC: wheelchair, cannot walk at all. BLND: blind or low vision. DEAF: deaf or hard of hearing. DPNA: intellectual or developmental disability."
          },
          "meet_at": {
            "type": "string",
            "enum": [
              "arrival_gate",
              "transfer_security",
              "onward_gate"
            ],
            "description": "Where the host should meet the traveller."
          }
        },
        "required": [
          "code",
          "meet_at"
        ],
        "additionalProperties": false
      },
      "SubscriptionRequest": {
        "type": "object",
        "properties": {
          "callback_url": {
            "type": "string",
            "description": "Where the events are sent: an https URL on port 443 at a public address. Redirects are not followed."
          },
          "secret": {
            "type": "string",
            "description": "The signing secret of Standard Webhooks: whsec_ followed by the base64 of 24 to 64 bytes. Sending the same callback_url and events again replaces it."
          },
          "events": {
            "description": "The events to receive. Left out: all eight.",
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "journey.flight.updated",
                "journey.gate.assigned",
                "journey.gate.changed",
                "journey.boarding.opened",
                "journey.time_budget.changed",
                "journey.assist.updated",
                "journey.offer.published",
                "journey.ended"
              ]
            }
          },
          "ttl_seconds": {
            "description": "How long the subscription should last. It never outlasts the journey. Left out: as long as allowed.",
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "callback_url",
          "secret"
        ]
      },
      "PairRequest": {
        "type": "object",
        "properties": {
          "pairing_code": {
            "type": "string",
            "description": "The code the traveller was shown after consent. Valid for 10 minutes, and only once."
          }
        },
        "required": [
          "pairing_code"
        ]
      },
      "LegView": {
        "type": "object",
        "properties": {
          "flight": {
            "type": "string",
            "pattern": "^[A-Z0-9]{2}[1-9][0-9]{0,3}$"
          },
          "from": {
            "type": "string",
            "pattern": "^[A-Z]{3}$"
          },
          "to": {
            "type": "string",
            "pattern": "^[A-Z]{3}$"
          },
          "status": {
            "type": "string",
            "enum": [
              "scheduled",
              "boarding",
              "departed",
              "airborne",
              "landed",
              "arrived",
              "cancelled",
              "diverted",
              "unknown"
            ]
          },
          "departure": {
            "type": "object",
            "properties": {
              "terminal": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^[A-Z0-9]{1,5}$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "gate": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^[A-Z0-9]{1,5}$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "scheduled": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "estimated": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "actual": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "terminal",
              "gate",
              "scheduled",
              "estimated",
              "actual"
            ],
            "additionalProperties": false,
            "description": "At the departure airport, in its local time. scheduled, estimated and actual are off-blocks times."
          },
          "arrival": {
            "type": "object",
            "properties": {
              "terminal": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^[A-Z0-9]{1,5}$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "gate": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^[A-Z0-9]{1,5}$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "stand": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^[A-Z0-9]{1,5}$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "scheduled": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "estimated": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "actual": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "touchdown_estimated": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "touchdown": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "terminal",
              "gate",
              "stand",
              "scheduled",
              "estimated",
              "actual",
              "touchdown_estimated",
              "touchdown"
            ],
            "additionalProperties": false,
            "description": "At the arrival airport, in its local time. scheduled, estimated and actual are on-blocks times; touchdown is wheels down."
          },
          "boarding": {
            "type": "object",
            "properties": {
              "opens_at": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "closes_at": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "opens_at",
              "closes_at"
            ],
            "additionalProperties": false,
            "description": "Boarding at the departure gate. null when the source does not say."
          },
          "basis": {
            "type": "string",
            "enum": [
              "live",
              "schedule",
              "estimate",
              "default",
              "placeholder",
              "simulated"
            ],
            "description": "Where this record comes from."
          },
          "source": {
            "type": "string",
            "enum": [
              "sim",
              "oag"
            ]
          },
          "observed_at": {
            "type": "string",
            "description": "When the source was last read."
          },
          "stale": {
            "type": "boolean",
            "description": "True when the record could not be refreshed on schedule."
          }
        },
        "required": [
          "flight",
          "from",
          "to",
          "status",
          "departure",
          "arrival",
          "boarding",
          "basis",
          "source",
          "observed_at",
          "stale"
        ],
        "additionalProperties": false
      },
      "AnchorView": {
        "type": "object",
        "properties": {
          "place": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_]{1,40}$",
            "description": "A gate code, transfer_security_cleared, or a place id."
          },
          "kind": {
            "type": "string",
            "enum": [
              "arrival_gate",
              "gate",
              "transfer_security_cleared",
              "place"
            ]
          },
          "label": {
            "type": "string"
          },
          "basis": {
            "type": "string",
            "enum": [
              "assumed",
              "reported"
            ],
            "description": "assumed: the arrival gate, because nobody said otherwise. reported: an assistant passed it as at or from."
          },
          "as_of": {
            "type": "string",
            "description": "When the traveller was there. For an assumed anchor: when the aircraft door opens."
          },
          "age_minutes": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991,
            "description": "Minutes since as_of."
          }
        },
        "required": [
          "place",
          "kind",
          "label",
          "basis",
          "as_of",
          "age_minutes"
        ],
        "additionalProperties": false
      },
      "TimeBudgetView": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "comfortable",
              "tight",
              "at_risk",
              "unknown"
            ],
            "description": "comfortable: 12 or more free minutes. tight: 4 to 11. at_risk: fewer than 4. unknown: see reason."
          },
          "reason": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "flight_disrupted",
                  "onward_gate_unknown",
                  "gate_not_in_graph",
                  "arrival_gate_unknown",
                  "anchor_not_in_graph"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "Why the status is unknown; otherwise null."
          },
          "free_minutes": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ],
            "description": "Slack left if the traveller sets off from the anchor now. Negative once leave_by has passed."
          },
          "leave_by": {
            "description": "Latest time to set off from the anchor.",
            "type": [
              "string",
              "null"
            ]
          },
          "need_minutes": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ],
            "description": "Walking minutes at the pace of the traveller, plus the security wait when it is still ahead."
          },
          "anchor": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AnchorView"
              },
              {
                "type": "null"
              }
            ],
            "description": "The place the budget is counted from. Read its basis and age_minutes before relaying the budget."
          },
          "board_close": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "at": {
                    "type": "string"
                  },
                  "basis": {
                    "type": "string",
                    "enum": [
                      "live",
                      "schedule",
                      "estimate",
                      "default",
                      "placeholder",
                      "simulated"
                    ]
                  }
                },
                "required": [
                  "at",
                  "basis"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "When boarding closes."
          },
          "door_open": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "at": {
                    "type": "string"
                  },
                  "basis": {
                    "type": "string",
                    "enum": [
                      "live",
                      "schedule",
                      "estimate",
                      "default",
                      "placeholder",
                      "simulated"
                    ]
                  }
                },
                "required": [
                  "at",
                  "basis"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "When the inbound aircraft door opens: on blocks plus 2 minutes."
          },
          "walk": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "minutes": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  "basis": {
                    "type": "string",
                    "enum": [
                      "live",
                      "schedule",
                      "estimate",
                      "default",
                      "placeholder",
                      "simulated"
                    ]
                  }
                },
                "required": [
                  "minutes",
                  "basis"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "Walk from the anchor to the onward gate at the pace of the traveller."
          },
          "wait": {
            "type": "object",
            "properties": {
              "minutes": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "basis": {
                "type": "string",
                "enum": [
                  "live",
                  "schedule",
                  "estimate",
                  "default",
                  "placeholder",
                  "simulated"
                ]
              },
              "applies": {
                "type": "boolean"
              }
            },
            "required": [
              "minutes",
              "basis",
              "applies"
            ],
            "additionalProperties": false,
            "description": "Transfer security wait. applies is false once security is behind the traveller."
          },
          "margin": {
            "type": "object",
            "properties": {
              "minutes": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "basis": {
                "type": "string",
                "enum": [
                  "live",
                  "schedule",
                  "estimate",
                  "default",
                  "placeholder",
                  "simulated"
                ]
              }
            },
            "required": [
              "minutes",
              "basis"
            ],
            "additionalProperties": false,
            "description": "Safety margin kept before boarding closes."
          },
          "pace": {
            "type": "object",
            "properties": {
              "value": {
                "type": "string",
                "enum": [
                  "brisk",
                  "average",
                  "slow"
                ]
              },
              "factor": {
                "type": "number"
              },
              "basis": {
                "type": "string",
                "enum": [
                  "live",
                  "schedule",
                  "estimate",
                  "default",
                  "placeholder",
                  "simulated"
                ]
              }
            },
            "required": [
              "value",
              "factor",
              "basis"
            ],
            "additionalProperties": false,
            "description": "Walking pace and the factor applied to walking minutes."
          },
          "assisted": {
            "type": "object",
            "properties": {
              "assisted_lane": {
                "type": "boolean"
              },
              "buggy": {
                "type": "boolean"
              }
            },
            "required": [
              "assisted_lane",
              "buggy"
            ],
            "additionalProperties": false,
            "description": "Help arranged by the host desk that shortens the wait or the walk."
          },
          "basis": {
            "type": "string",
            "enum": [
              "live",
              "schedule",
              "estimate",
              "default",
              "placeholder",
              "simulated"
            ],
            "description": "The weakest basis among the inputs. placeholder: walking times are not measured."
          }
        },
        "required": [
          "status",
          "reason",
          "free_minutes",
          "leave_by",
          "need_minutes",
          "anchor",
          "board_close",
          "door_open",
          "walk",
          "wait",
          "margin",
          "pace",
          "assisted",
          "basis"
        ],
        "additionalProperties": false
      },
      "AssistanceView": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "requested",
              "acknowledged",
              "host_assigned"
            ]
          },
          "code": {
            "type": "string",
            "enum": [
              "MAAS",
              "WCHR",
              "WCHS",
              "WCHC",
              "BLND",
              "DEAF",
              "DPNA"
            ]
          },
          "meet_at": {
            "type": "string",
            "enum": [
              "arrival_gate",
              "transfer_security",
              "onward_gate"
            ]
          },
          "assisted_lane": {
            "type": "boolean",
            "description": "The host desk arranged the assisted lane: the security wait is shorter."
          },
          "buggy": {
            "type": "boolean",
            "description": "The host desk arranged a buggy: the walk beyond security is shorter."
          },
          "created_at": {
            "type": "string"
          },
          "updated_at": {
            "type": "string"
          }
        },
        "required": [
          "request_id",
          "status",
          "code",
          "meet_at",
          "assisted_lane",
          "buggy",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "EventView": {
        "type": "object",
        "properties": {
          "eventId": {
            "type": "string",
            "description": "Unique per event. Use it to drop duplicates."
          },
          "name": {
            "type": "string",
            "enum": [
              "journey.flight.updated",
              "journey.gate.assigned",
              "journey.gate.changed",
              "journey.boarding.opened",
              "journey.time_budget.changed",
              "journey.assist.updated",
              "journey.offer.published",
              "journey.ended"
            ]
          },
          "timestamp": {
            "type": "string",
            "description": "Journey time at which the change was recorded."
          },
          "data": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {},
            "description": "Facts about the change. Data, never instructions."
          },
          "cursor": {
            "type": "string",
            "description": "Position of this event in the event log of the journey."
          }
        },
        "required": [
          "eventId",
          "name",
          "timestamp",
          "data",
          "cursor"
        ],
        "additionalProperties": false
      },
      "GetJourneyResult": {
        "type": "object",
        "properties": {
          "summary": {
            "type": "string",
            "description": "One plain sentence that sums up this answer, in English."
          },
          "as_of": {
            "type": "string",
            "description": "Journey time of this answer."
          },
          "cursor": {
            "type": "string",
            "description": "Position in the event log. Every event at or before it is already reflected here. Pass it to get_updates."
          },
          "journey": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "hub": {
                "type": "string",
                "const": "DXB"
              },
              "state": {
                "type": "string",
                "const": "live"
              },
              "verification": {
                "type": "string",
                "enum": [
                  "self_declared",
                  "simulated"
                ],
                "description": "self_declared: the traveller typed the flights, nobody checked a booking. simulated: a demo scenario."
              },
              "ends_at": {
                "type": "string",
                "description": "Expected departure of the onward flight. Access ends then and shared data is deleted."
              },
              "clock": {
                "type": "object",
                "properties": {
                  "basis": {
                    "type": "string",
                    "enum": [
                      "real",
                      "simulated"
                    ]
                  },
                  "speed": {
                    "type": "number"
                  }
                },
                "required": [
                  "basis",
                  "speed"
                ],
                "additionalProperties": false,
                "description": "A simulated journey runs on an accelerated clock. Every time in an answer is journey time."
              }
            },
            "required": [
              "id",
              "hub",
              "state",
              "verification",
              "ends_at",
              "clock"
            ],
            "additionalProperties": false
          },
          "inbound": {
            "$ref": "#/components/schemas/LegView"
          },
          "onward": {
            "$ref": "#/components/schemas/LegView"
          },
          "time_budget": {
            "$ref": "#/components/schemas/TimeBudgetView"
          },
          "share": {
            "type": "object",
            "properties": {
              "lang": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^[A-Za-z]{2,3}(-[A-Za-z0-9]{1,8}){0,5}$"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "BCP 47 language tag. null: not shared."
              },
              "pace": {
                "anyOf": [
                  {
                    "type": "string",
                    "enum": [
                      "brisk",
                      "average",
                      "slow"
                    ]
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Walking pace. null: not shared, so average is assumed."
              },
              "ssr": {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "MAAS",
                    "WCHR",
                    "WCHS",
                    "WCHC",
                    "BLND",
                    "DEAF",
                    "DPNA"
                  ]
                },
                "description": "Special service codes the traveller declared."
              },
              "offers": {
                "type": "boolean",
                "description": "True when the traveller opted in to offers from shops."
              },
              "meet": {
                "type": "boolean",
                "description": "True when the traveller allowed requests for someone to meet them."
              }
            },
            "required": [
              "lang",
              "pace",
              "ssr",
              "offers",
              "meet"
            ],
            "additionalProperties": false,
            "description": "What the traveller chose to share."
          },
          "assistance": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AssistanceView"
            }
          },
          "offers": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "place_id": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_]{1,40}$"
                },
                "category": {
                  "type": "string",
                  "enum": [
                    "quiet_seating",
                    "prayer_room",
                    "food",
                    "water",
                    "restroom",
                    "pharmacy",
                    "lounge"
                  ]
                },
                "discount_percent": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991
                },
                "published_at": {
                  "type": "string"
                }
              },
              "required": [
                "place_id",
                "category",
                "discount_percent",
                "published_at"
              ],
              "additionalProperties": false
            },
            "description": "Offers published so far on this journey. Always empty unless the traveller opted in to offers."
          }
        },
        "required": [
          "summary",
          "as_of",
          "cursor",
          "journey",
          "inbound",
          "onward",
          "time_budget",
          "share",
          "assistance",
          "offers"
        ],
        "additionalProperties": false
      },
      "GetRouteResult": {
        "type": "object",
        "properties": {
          "summary": {
            "type": "string",
            "description": "One plain sentence that sums up this answer, in English."
          },
          "as_of": {
            "type": "string",
            "description": "Journey time of this answer."
          },
          "from": {
            "$ref": "#/components/schemas/AnchorView"
          },
          "to": {
            "type": "object",
            "properties": {
              "place": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_]{1,40}$"
              },
              "kind": {
                "type": "string",
                "enum": [
                  "gate",
                  "transfer_security_cleared",
                  "place"
                ]
              },
              "label": {
                "type": "string"
              }
            },
            "required": [
              "place",
              "kind",
              "label"
            ],
            "additionalProperties": false
          },
          "steps": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "seq": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991
                },
                "kind": {
                  "type": "string",
                  "enum": [
                    "walk",
                    "train",
                    "security_wait"
                  ]
                },
                "from": {
                  "type": "string"
                },
                "to": {
                  "type": "string"
                },
                "minutes": {
                  "type": "number",
                  "description": "At the pace of the traveller, one decimal."
                },
                "step_free": {
                  "type": "boolean"
                },
                "basis": {
                  "type": "string",
                  "enum": [
                    "live",
                    "schedule",
                    "estimate",
                    "default",
                    "placeholder",
                    "simulated"
                  ]
                }
              },
              "required": [
                "seq",
                "kind",
                "from",
                "to",
                "minutes",
                "step_free",
                "basis"
              ],
              "additionalProperties": false
            }
          },
          "walk_minutes": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "wait_minutes": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Transfer security wait, when the route passes it."
          },
          "total_minutes": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "walk_minutes plus wait_minutes."
          },
          "pace": {
            "type": "object",
            "properties": {
              "value": {
                "type": "string",
                "enum": [
                  "brisk",
                  "average",
                  "slow"
                ]
              },
              "factor": {
                "type": "number"
              },
              "basis": {
                "type": "string",
                "enum": [
                  "live",
                  "schedule",
                  "estimate",
                  "default",
                  "placeholder",
                  "simulated"
                ]
              }
            },
            "required": [
              "value",
              "factor",
              "basis"
            ],
            "additionalProperties": false,
            "description": "Walking pace and the factor applied to walking minutes."
          },
          "step_free": {
            "type": "boolean",
            "description": "True when every step is step-free."
          },
          "basis": {
            "type": "string",
            "enum": [
              "live",
              "schedule",
              "estimate",
              "default",
              "placeholder",
              "simulated"
            ]
          }
        },
        "required": [
          "summary",
          "as_of",
          "from",
          "to",
          "steps",
          "walk_minutes",
          "wait_minutes",
          "total_minutes",
          "pace",
          "step_free",
          "basis"
        ],
        "additionalProperties": false
      },
      "FindNearbyResult": {
        "type": "object",
        "properties": {
          "summary": {
            "type": "string",
            "description": "One plain sentence that sums up this answer, in English."
          },
          "as_of": {
            "type": "string",
            "description": "Journey time of this answer."
          },
          "anchor": {
            "$ref": "#/components/schemas/AnchorView"
          },
          "category": {
            "type": "string",
            "enum": [
              "quiet_seating",
              "prayer_room",
              "food",
              "water",
              "restroom",
              "pharmacy",
              "lounge"
            ]
          },
          "within_minutes": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "places": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "place_id": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_]{1,40}$",
                  "description": "Pass it as at, from or to."
                },
                "category": {
                  "type": "string",
                  "enum": [
                    "quiet_seating",
                    "prayer_room",
                    "food",
                    "water",
                    "restroom",
                    "pharmacy",
                    "lounge"
                  ]
                },
                "label": {
                  "type": "string"
                },
                "walk_minutes": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991
                },
                "total_minutes": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991,
                  "description": "walk_minutes plus the security wait when it is still ahead."
                },
                "on_the_way": {
                  "description": "True when the detour is 3 minutes or less. null: no onward gate yet.",
                  "type": [
                    "boolean",
                    "null"
                  ]
                },
                "detour_minutes": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "Extra walking compared with going straight to the onward gate. null: no onward gate yet."
                },
                "security_ahead": {
                  "type": "boolean",
                  "description": "True when transfer security lies between the traveller and this place."
                },
                "step_free": {
                  "type": "boolean"
                },
                "basis": {
                  "type": "string",
                  "enum": [
                    "live",
                    "schedule",
                    "estimate",
                    "default",
                    "placeholder",
                    "simulated"
                  ]
                }
              },
              "required": [
                "place_id",
                "category",
                "label",
                "walk_minutes",
                "total_minutes",
                "on_the_way",
                "detour_minutes",
                "security_ahead",
                "step_free",
                "basis"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "summary",
          "as_of",
          "anchor",
          "category",
          "within_minutes",
          "places"
        ],
        "additionalProperties": false
      },
      "GetUpdatesResult": {
        "type": "object",
        "properties": {
          "summary": {
            "type": "string",
            "description": "One plain sentence that sums up this answer, in English."
          },
          "as_of": {
            "type": "string",
            "description": "Journey time of this answer."
          },
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EventView"
            },
            "description": "Oldest first, at most 100."
          },
          "cursor": {
            "type": "string",
            "description": "Position after the last returned event. Pass it to the next get_updates."
          },
          "gap": {
            "type": "boolean",
            "description": "True when the cursor could not be used, so events may have been missed. Call get_journey for the current state."
          },
          "has_more": {
            "type": "boolean",
            "description": "True when more events are waiting. Call get_updates again with the new cursor."
          }
        },
        "required": [
          "summary",
          "as_of",
          "events",
          "cursor",
          "gap",
          "has_more"
        ],
        "additionalProperties": false
      },
      "RequestAssistanceResult": {
        "type": "object",
        "properties": {
          "summary": {
            "type": "string",
            "description": "One plain sentence that sums up this answer, in English."
          },
          "as_of": {
            "type": "string",
            "description": "Journey time of this answer."
          },
          "duplicate": {
            "type": "boolean",
            "description": "True when the same request was already open and is returned again."
          },
          "request_id": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "requested",
              "acknowledged",
              "host_assigned"
            ]
          },
          "code": {
            "type": "string",
            "enum": [
              "MAAS",
              "WCHR",
              "WCHS",
              "WCHC",
              "BLND",
              "DEAF",
              "DPNA"
            ]
          },
          "meet_at": {
            "type": "string",
            "enum": [
              "arrival_gate",
              "transfer_security",
              "onward_gate"
            ]
          },
          "assisted_lane": {
            "type": "boolean",
            "description": "The host desk arranged the assisted lane: the security wait is shorter."
          },
          "buggy": {
            "type": "boolean",
            "description": "The host desk arranged a buggy: the walk beyond security is shorter."
          },
          "created_at": {
            "type": "string"
          },
          "updated_at": {
            "type": "string"
          }
        },
        "required": [
          "summary",
          "as_of",
          "duplicate",
          "request_id",
          "status",
          "code",
          "meet_at",
          "assisted_lane",
          "buggy",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "JourneyFlightUpdatedData": {
        "type": "object",
        "properties": {
          "leg": {
            "type": "string",
            "enum": [
              "inbound",
              "onward"
            ]
          },
          "flight": {
            "type": "string",
            "pattern": "^[A-Z0-9]{2}[1-9][0-9]{0,3}$"
          },
          "changed": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "status",
                "stale",
                "departure.terminal",
                "departure.gate",
                "departure.scheduled",
                "departure.estimated",
                "departure.actual",
                "arrival.terminal",
                "arrival.gate",
                "arrival.stand",
                "arrival.scheduled",
                "arrival.estimated",
                "arrival.actual",
                "arrival.touchdown_estimated",
                "arrival.touchdown",
                "boarding.opens_at",
                "boarding.closes_at"
              ]
            },
            "description": "Paths of the fields that changed. Their new values follow."
          },
          "status": {
            "type": "string",
            "enum": [
              "scheduled",
              "boarding",
              "departed",
              "airborne",
              "landed",
              "arrived",
              "cancelled",
              "diverted",
              "unknown"
            ]
          },
          "basis": {
            "type": "string",
            "enum": [
              "live",
              "schedule",
              "estimate",
              "default",
              "placeholder",
              "simulated"
            ]
          },
          "stale": {
            "type": "boolean"
          },
          "departure": {
            "type": "object",
            "properties": {
              "terminal": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^[A-Z0-9]{1,5}$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "gate": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^[A-Z0-9]{1,5}$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "scheduled": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "estimated": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "actual": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "additionalProperties": false
          },
          "arrival": {
            "type": "object",
            "properties": {
              "terminal": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^[A-Z0-9]{1,5}$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "gate": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^[A-Z0-9]{1,5}$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "stand": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^[A-Z0-9]{1,5}$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "scheduled": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "estimated": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "actual": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "touchdown_estimated": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "touchdown": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "additionalProperties": false
          },
          "boarding": {
            "type": "object",
            "properties": {
              "opens_at": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "closes_at": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "additionalProperties": false
          }
        },
        "required": [
          "leg",
          "flight",
          "changed",
          "status",
          "basis",
          "stale"
        ],
        "additionalProperties": false
      },
      "JourneyGateAssignedData": {
        "type": "object",
        "properties": {
          "leg": {
            "type": "string",
            "const": "onward"
          },
          "flight": {
            "type": "string",
            "pattern": "^[A-Z0-9]{2}[1-9][0-9]{0,3}$"
          },
          "gate": {
            "type": "string",
            "pattern": "^[A-Z0-9]{1,5}$"
          },
          "terminal": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[A-Z0-9]{1,5}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "basis": {
            "type": "string",
            "enum": [
              "live",
              "schedule",
              "estimate",
              "default",
              "placeholder",
              "simulated"
            ]
          }
        },
        "required": [
          "leg",
          "flight",
          "gate",
          "terminal",
          "basis"
        ],
        "additionalProperties": false
      },
      "JourneyGateChangedData": {
        "type": "object",
        "properties": {
          "leg": {
            "type": "string",
            "const": "onward"
          },
          "flight": {
            "type": "string",
            "pattern": "^[A-Z0-9]{2}[1-9][0-9]{0,3}$"
          },
          "from_gate": {
            "type": "string",
            "pattern": "^[A-Z0-9]{1,5}$"
          },
          "to_gate": {
            "type": "string",
            "pattern": "^[A-Z0-9]{1,5}$"
          },
          "terminal": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[A-Z0-9]{1,5}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "basis": {
            "type": "string",
            "enum": [
              "live",
              "schedule",
              "estimate",
              "default",
              "placeholder",
              "simulated"
            ]
          }
        },
        "required": [
          "leg",
          "flight",
          "from_gate",
          "to_gate",
          "terminal",
          "basis"
        ],
        "additionalProperties": false
      },
      "JourneyBoardingOpenedData": {
        "type": "object",
        "properties": {
          "leg": {
            "type": "string",
            "const": "onward"
          },
          "flight": {
            "type": "string",
            "pattern": "^[A-Z0-9]{2}[1-9][0-9]{0,3}$"
          },
          "gate": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[A-Z0-9]{1,5}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "closes_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "basis": {
            "type": "string",
            "enum": [
              "live",
              "schedule",
              "estimate",
              "default",
              "placeholder",
              "simulated"
            ]
          }
        },
        "required": [
          "leg",
          "flight",
          "gate",
          "closes_at",
          "basis"
        ],
        "additionalProperties": false
      },
      "JourneyTimeBudgetChangedData": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "comfortable",
              "tight",
              "at_risk",
              "unknown"
            ]
          },
          "free_minutes": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ],
            "description": "Slack left if the traveller sets off from the anchor now."
          },
          "leave_by": {
            "type": [
              "string",
              "null"
            ]
          },
          "anchor": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "place": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_]{1,40}$"
                  },
                  "kind": {
                    "type": "string",
                    "enum": [
                      "arrival_gate",
                      "gate",
                      "transfer_security_cleared",
                      "place"
                    ]
                  },
                  "basis": {
                    "type": "string",
                    "enum": [
                      "assumed",
                      "reported"
                    ]
                  }
                },
                "required": [
                  "place",
                  "kind",
                  "basis"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "The place the budget is counted from."
          },
          "cause": {
            "type": "string",
            "enum": [
              "flight_status_changed",
              "gate_assigned",
              "gate_changed",
              "arrival_gate_assigned",
              "inbound_time_changed",
              "onward_time_changed",
              "assistance_changed",
              "anchor_reported",
              "leave_by_reached"
            ]
          },
          "basis": {
            "type": "string",
            "enum": [
              "live",
              "schedule",
              "estimate",
              "default",
              "placeholder",
              "simulated"
            ]
          }
        },
        "required": [
          "status",
          "free_minutes",
          "leave_by",
          "anchor",
          "cause",
          "basis"
        ],
        "additionalProperties": false
      },
      "JourneyAssistUpdatedData": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "requested",
              "acknowledged",
              "host_assigned"
            ]
          },
          "code": {
            "type": "string",
            "enum": [
              "MAAS",
              "WCHR",
              "WCHS",
              "WCHC",
              "BLND",
              "DEAF",
              "DPNA"
            ]
          },
          "meet_at": {
            "type": "string",
            "enum": [
              "arrival_gate",
              "transfer_security",
              "onward_gate"
            ]
          },
          "assisted_lane": {
            "type": "boolean",
            "description": "The host desk arranged the assisted lane: the security wait is shorter."
          },
          "buggy": {
            "type": "boolean",
            "description": "The host desk arranged a buggy: the walk beyond security is shorter."
          }
        },
        "required": [
          "request_id",
          "status",
          "code",
          "meet_at",
          "assisted_lane",
          "buggy"
        ],
        "additionalProperties": false
      },
      "JourneyOfferPublishedData": {
        "type": "object",
        "properties": {
          "place_id": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_]{1,40}$"
          },
          "category": {
            "type": "string",
            "enum": [
              "quiet_seating",
              "prayer_room",
              "food",
              "water",
              "restroom",
              "pharmacy",
              "lounge"
            ]
          },
          "discount_percent": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          }
        },
        "required": [
          "place_id",
          "category",
          "discount_percent"
        ],
        "additionalProperties": false
      },
      "JourneyEndedData": {
        "type": "object",
        "properties": {
          "reason": {
            "type": "string",
            "enum": [
              "departed",
              "expired",
              "revoked"
            ]
          }
        },
        "required": [
          "reason"
        ],
        "additionalProperties": false
      },
      "JourneyEvent": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "eventId": {
                "type": "string",
                "description": "Unique per event. Use it to drop duplicates."
              },
              "name": {
                "type": "string",
                "const": "journey.flight.updated"
              },
              "timestamp": {
                "type": "string",
                "description": "Journey time at which the change was recorded."
              },
              "data": {
                "$ref": "#/components/schemas/JourneyFlightUpdatedData"
              },
              "cursor": {
                "type": "string",
                "description": "Position of this event in the event log of the journey."
              }
            },
            "required": [
              "eventId",
              "name",
              "timestamp",
              "data",
              "cursor"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "eventId": {
                "type": "string",
                "description": "Unique per event. Use it to drop duplicates."
              },
              "name": {
                "type": "string",
                "const": "journey.gate.assigned"
              },
              "timestamp": {
                "type": "string",
                "description": "Journey time at which the change was recorded."
              },
              "data": {
                "$ref": "#/components/schemas/JourneyGateAssignedData"
              },
              "cursor": {
                "type": "string",
                "description": "Position of this event in the event log of the journey."
              }
            },
            "required": [
              "eventId",
              "name",
              "timestamp",
              "data",
              "cursor"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "eventId": {
                "type": "string",
                "description": "Unique per event. Use it to drop duplicates."
              },
              "name": {
                "type": "string",
                "const": "journey.gate.changed"
              },
              "timestamp": {
                "type": "string",
                "description": "Journey time at which the change was recorded."
              },
              "data": {
                "$ref": "#/components/schemas/JourneyGateChangedData"
              },
              "cursor": {
                "type": "string",
                "description": "Position of this event in the event log of the journey."
              }
            },
            "required": [
              "eventId",
              "name",
              "timestamp",
              "data",
              "cursor"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "eventId": {
                "type": "string",
                "description": "Unique per event. Use it to drop duplicates."
              },
              "name": {
                "type": "string",
                "const": "journey.boarding.opened"
              },
              "timestamp": {
                "type": "string",
                "description": "Journey time at which the change was recorded."
              },
              "data": {
                "$ref": "#/components/schemas/JourneyBoardingOpenedData"
              },
              "cursor": {
                "type": "string",
                "description": "Position of this event in the event log of the journey."
              }
            },
            "required": [
              "eventId",
              "name",
              "timestamp",
              "data",
              "cursor"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "eventId": {
                "type": "string",
                "description": "Unique per event. Use it to drop duplicates."
              },
              "name": {
                "type": "string",
                "const": "journey.time_budget.changed"
              },
              "timestamp": {
                "type": "string",
                "description": "Journey time at which the change was recorded."
              },
              "data": {
                "$ref": "#/components/schemas/JourneyTimeBudgetChangedData"
              },
              "cursor": {
                "type": "string",
                "description": "Position of this event in the event log of the journey."
              }
            },
            "required": [
              "eventId",
              "name",
              "timestamp",
              "data",
              "cursor"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "eventId": {
                "type": "string",
                "description": "Unique per event. Use it to drop duplicates."
              },
              "name": {
                "type": "string",
                "const": "journey.assist.updated"
              },
              "timestamp": {
                "type": "string",
                "description": "Journey time at which the change was recorded."
              },
              "data": {
                "$ref": "#/components/schemas/JourneyAssistUpdatedData"
              },
              "cursor": {
                "type": "string",
                "description": "Position of this event in the event log of the journey."
              }
            },
            "required": [
              "eventId",
              "name",
              "timestamp",
              "data",
              "cursor"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "eventId": {
                "type": "string",
                "description": "Unique per event. Use it to drop duplicates."
              },
              "name": {
                "type": "string",
                "const": "journey.offer.published"
              },
              "timestamp": {
                "type": "string",
                "description": "Journey time at which the change was recorded."
              },
              "data": {
                "$ref": "#/components/schemas/JourneyOfferPublishedData"
              },
              "cursor": {
                "type": "string",
                "description": "Position of this event in the event log of the journey."
              }
            },
            "required": [
              "eventId",
              "name",
              "timestamp",
              "data",
              "cursor"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "eventId": {
                "type": "string",
                "description": "Unique per event. Use it to drop duplicates."
              },
              "name": {
                "type": "string",
                "const": "journey.ended"
              },
              "timestamp": {
                "type": "string",
                "description": "Journey time at which the change was recorded."
              },
              "data": {
                "$ref": "#/components/schemas/JourneyEndedData"
              },
              "cursor": {
                "type": "string",
                "description": "Position of this event in the event log of the journey."
              }
            },
            "required": [
              "eventId",
              "name",
              "timestamp",
              "data",
              "cursor"
            ],
            "additionalProperties": false
          }
        ]
      },
      "StreamGap": {
        "type": "object",
        "properties": {
          "cursor": {
            "type": "string",
            "description": "The head of the event log. Events before it may have been missed: get the journey."
          }
        },
        "required": [
          "cursor"
        ],
        "additionalProperties": false
      },
      "StreamTerminated": {
        "type": "object",
        "properties": {
          "reason": {
            "type": "string",
            "const": "journey_ended"
          }
        },
        "required": [
          "reason"
        ],
        "additionalProperties": false
      },
      "VerificationMessage": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "verification"
          },
          "challenge": {
            "type": "string",
            "description": "Answer with status 2xx and the JSON body {\"challenge\": \"<this value>\"}."
          }
        },
        "required": [
          "type",
          "challenge"
        ],
        "additionalProperties": false
      },
      "GapMessage": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "gap"
          },
          "cursor": {
            "type": "string",
            "description": "The watermark of the subscription: every event at or before it was delivered or given up."
          }
        },
        "required": [
          "type",
          "cursor"
        ],
        "additionalProperties": false
      },
      "TerminatedMessage": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "terminated"
          },
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "number",
                "const": -32024
              },
              "message": {
                "type": "string",
                "const": "Forbidden"
              },
              "data": {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "const": "journey_ended"
                  }
                },
                "required": [
                  "reason"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "code",
              "message",
              "data"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "type",
          "error"
        ],
        "additionalProperties": false
      },
      "Subscription": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Fixed by the journey, the callback URL and the events: the same request gives the same id."
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "journey.flight.updated",
                "journey.gate.assigned",
                "journey.gate.changed",
                "journey.boarding.opened",
                "journey.time_budget.changed",
                "journey.assist.updated",
                "journey.offer.published",
                "journey.ended"
              ]
            }
          },
          "refresh_before": {
            "type": "string",
            "description": "Real time, ISO 8601 in UTC. Send the same request again before then to keep the subscription."
          },
          "cursor": {
            "type": "string",
            "description": "The watermark of the subscription: every event at or before it was delivered or given up."
          }
        },
        "required": [
          "id",
          "events",
          "refresh_before",
          "cursor"
        ],
        "additionalProperties": false
      },
      "SubscriptionList": {
        "type": "object",
        "properties": {
          "subscriptions": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "Fixed by the journey, the callback URL and the events: the same request gives the same id."
                },
                "events": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "enum": [
                      "journey.flight.updated",
                      "journey.gate.assigned",
                      "journey.gate.changed",
                      "journey.boarding.opened",
                      "journey.time_budget.changed",
                      "journey.assist.updated",
                      "journey.offer.published",
                      "journey.ended"
                    ]
                  }
                },
                "refresh_before": {
                  "type": "string",
                  "description": "Real time, ISO 8601 in UTC. Send the same request again before then to keep the subscription."
                },
                "cursor": {
                  "type": "string",
                  "description": "The watermark of the subscription: every event at or before it was delivered or given up."
                },
                "callback_url": {
                  "type": "string"
                },
                "delivery_status": {
                  "type": "object",
                  "properties": {
                    "active": {
                      "type": "boolean"
                    },
                    "last_error": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "connection_refused",
                            "timeout",
                            "tls_error",
                            "http_4xx",
                            "http_5xx",
                            "challenge_failed"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "description": "How the latest attempt failed. null: it did not."
                    },
                    "last_delivery_at": {
                      "description": "Real time of the latest accepted delivery, ISO 8601 in UTC. Absent before the first one.",
                      "type": "string"
                    },
                    "failed_since": {
                      "description": "Real time since which every attempt fails, ISO 8601 in UTC. Absent while deliveries succeed.",
                      "type": "string"
                    }
                  },
                  "required": [
                    "active",
                    "last_error"
                  ],
                  "additionalProperties": false
                }
              },
              "required": [
                "id",
                "events",
                "refresh_before",
                "cursor",
                "callback_url",
                "delivery_status"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "subscriptions"
        ],
        "additionalProperties": false
      },
      "SubscriptionError": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "description": "invalid_input, callback_endpoint_error, subscription_limit, rate_limited, forbidden or internal_error."
          },
          "reason": {
            "description": "With callback_endpoint_error: how the verification failed.",
            "type": "string",
            "enum": [
              "connection_refused",
              "timeout",
              "tls_error",
              "http_4xx",
              "http_5xx",
              "challenge_failed"
            ]
          },
          "max": {
            "description": "With subscription_limit: how many subscriptions a journey may have.",
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "error"
        ],
        "additionalProperties": {}
      },
      "Token": {
        "type": "object",
        "properties": {
          "access_token": {
            "type": "string",
            "description": "The bearer token of the journey."
          },
          "token_type": {
            "type": "string",
            "const": "Bearer"
          },
          "expires_in": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Seconds. Access ends earlier, when the journey ends."
          },
          "scope": {
            "type": "string",
            "description": "The granted scopes, separated by spaces."
          }
        },
        "required": [
          "access_token",
          "token_type",
          "expires_in",
          "scope"
        ],
        "additionalProperties": false
      },
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "description": "A stable code to act on."
          },
          "message": {
            "type": "string",
            "description": "One fixed sentence in English. Never text from a third party."
          }
        },
        "required": [
          "error",
          "message"
        ],
        "additionalProperties": {}
      },
      "OAuthError": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "description": "An OAuth error code, such as invalid_token or invalid_grant."
          },
          "error_description": {
            "type": "string"
          }
        },
        "required": [
          "error",
          "error_description"
        ],
        "additionalProperties": false
      }
    },
    "responses": {
      "InvalidInput": {
        "description": "`invalid_input`: the parameters or the body do not match what the operation accepts. `unknown_place`: a place is neither a gate, `transfer_security_cleared` nor a known place id.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Unauthorized": {
        "description": "No bearer token, or one that is unknown, expired or revoked, or whose journey has ended: access ends with the journey. The challenge points at the protected resource metadata.",
        "headers": {
          "WWW-Authenticate": {
            "description": "A Bearer challenge.",
            "schema": {
              "type": "string"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/OAuthError"
            }
          }
        }
      },
      "InsufficientScope": {
        "description": "`insufficient_scope`: the traveller did not grant the scope this route needs. The challenge names it.",
        "headers": {
          "WWW-Authenticate": {
            "description": "A Bearer challenge.",
            "schema": {
              "type": "string"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "NotNow": {
        "description": "`onward_gate_unknown`, `anchor_unknown` or `assistance_limit`: the request is valid, but the journey cannot answer it in its present state.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "RateLimited": {
        "description": "`rate_limited`: too many requests with this token, or too many open streams.",
        "headers": {
          "Retry-After": {
            "description": "Seconds to wait.",
            "schema": {
              "type": "integer"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Failed": {
        "description": "`internal_error`: the service could not complete the request.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    },
    "pathItems": {
      "Delivery": {
        "post": {
          "summary": "A signed message to a callback URL",
          "description": "One message per request, signed as Standard Webhooks define it: `webhook-signature` is `v1,` followed by the base64 HMAC-SHA256 of `<webhook-id>.<webhook-timestamp>.<body>` under the secret of the subscription. Check the signature over the raw body before reading it. A message can arrive twice or out of order: drop repeats by `eventId`, and take an event as a hint to get the journey again. In an event sent here, `cursor` is the watermark of the subscription and not the position of that event. A message with a `type` is not an event: `verification` must be answered with its challenge, `gap` says that events were given up on, and `terminated` says that the journey ended.",
          "security": [],
          "parameters": [
            {
              "name": "webhook-id",
              "in": "header",
              "required": true,
              "description": "The same across the attempts of one message. For an event it is normally its `eventId`.",
              "schema": {
                "type": "string"
              }
            },
            {
              "name": "webhook-timestamp",
              "in": "header",
              "required": true,
              "description": "Real time of this attempt, in seconds since 1970.",
              "schema": {
                "type": "integer"
              }
            },
            {
              "name": "webhook-signature",
              "in": "header",
              "required": true,
              "description": "Made anew for every attempt.",
              "schema": {
                "type": "string"
              }
            },
            {
              "name": "X-MCP-Subscription-Id",
              "in": "header",
              "required": true,
              "schema": {
                "type": "string"
              }
            }
          ],
          "requestBody": {
            "required": true,
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/JourneyEvent"
                    },
                    {
                      "$ref": "#/components/schemas/VerificationMessage"
                    },
                    {
                      "$ref": "#/components/schemas/GapMessage"
                    },
                    {
                      "$ref": "#/components/schemas/TerminatedMessage"
                    }
                  ]
                }
              }
            }
          },
          "responses": {
            "410": {
              "description": "This delivery is not retried. The subscription continues."
            },
            "413": {
              "description": "This delivery is not retried. The subscription continues."
            },
            "2XX": {
              "description": "Accepted. A `verification` message must be answered with the JSON body `{\"challenge\": \"<its challenge>\"}`."
            },
            "default": {
              "description": "Anything else, a redirect included, is a failed attempt. An event is sent at most 5 times within 8 minutes and then given up on, which a `gap` message reports."
            }
          }
        }
      }
    },
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer",
        "description": "The access token of one journey, from the OAuth flow or from `POST /v0/pair`. It stops working when the journey ends. Never accepted in the query string."
      },
      "oauth2": {
        "type": "oauth2",
        "description": "OAuth 2.1 authorization code. PKCE S256 required. Public clients only: the client id is the URL of a Client ID Metadata Document, or comes from dynamic registration. One approval is one journey: the traveller enters the flights on the consent page. Authorization server metadata: https://open-layer.dev/.well-known/oauth-authorization-server",
        "flows": {
          "authorizationCode": {
            "authorizationUrl": "https://open-layer.dev/authorize",
            "tokenUrl": "https://open-layer.dev/token",
            "scopes": {
              "journey.read": "Read the journey, its updates and its events.",
              "route.read": "Read routes and nearby places.",
              "assist.request": "Ask for someone to meet the traveller. Granted only when the traveller allowed it."
            }
          }
        }
      }
    }
  }
}
