{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://schemas.ruter.no/adt/ota/api/v3.0/pe/dpi/journey/dpi-journey.json",
  "type": "object",
  "title": "DpiJourney",
  "description": "List of stops for current journey in block",
  "required": [
    "eventTimestamp",
    "traceId",
    "route"
  ],
  "additionalProperties": true,
  "properties": {
    "eventTimestamp": {
      "$id": "#/properties/eventTimestamp",
      "type": "string",
      "description": "As specified in the [ADT documentation.](https://adt.transhub.io)",
      "format": "date-time"
    },
    "traceId": {
      "$id": "#/properties/traceId",
      "type": "string",
      "description": "A unique identifier - UUID"
    },
    "journeyId": {
      "$id": "#/properties/journeyId",
      "type": "string",
      "description": "Ruter's external journey id"
    },
    "journeyRef": {
      "$id": "#/properties/journeyRef",
      "type": "string",
      "description": "Ruter's internal journey reference"
    },
    "routeChangeTimestamp": {
      "$id": "#/properties/routeChangeTimestamp",
      "type": "string",
      "description": "As specified in the [ADT documentation.](https://adt.transhub.io)",
      "format": "date-time"
    },
    "route": {
      "$id": "#/properties/route",
      "type": "object",
      "description": "Route information",
      "required": [
        "id",
        "name",
        "line",
        "journeyPatternRef",
        "stopPlaces"
      ],
      "additionalProperties": true,
      "properties": {
        "id": {
          "$id": "#/properties/route/properties/id",
          "type": "string",
          "description": "Route id"
        },
        "name": {
          "$id": "#/properties/route/properties/name",
          "type": "string",
          "description": "Public name of route"
        },
        "line": {
          "$id": "#/properties/route/properties/line",
          "type": "object",
          "description": "Line information",
          "required": [
            "id",
            "name",
            "publicCode"
          ],
          "additionalProperties": true,
          "properties": {
            "id": {
              "$id": "#/properties/route/properties/line/properties/id",
              "type": "string",
              "description": "Line id"
            },
            "name": {
              "$id": "#/properties/route/properties/line/properties/name",
              "type": "string",
              "description": "Public name of line"
            },
            "publicCode": {
              "$id": "#/properties/route/properties/line/properties/publicCode",
              "type": "string",
              "description": "Public code of line"
            }
          }
        },
        "journeyPatternRef": {
          "$id": "#/properties/route/properties/journeyPatternRef",
          "type": "string",
          "description": "Id identifying the journey pattern. Should be comparable to the JourneyPattern reference used by Entur."
        },
        "stopPlaces": {
          "$id": "#/properties/route/properties/stopPlaces",
          "type": "array",
          "description": "Ordered list of stop places on journey",
          "items": {
            "$id": "#/properties/route/properties/stopPlaces/items",
            "type": "object",
            "description": "Stop place info",
            "required": [
              "id",
              "name",
              "location",
              "tariffZones"
            ],
            "additionalProperties": true,
            "properties": {
              "id": {
                "$id": "#/properties/route/properties/stopPlaces/items/properties/id",
                "type": "string",
                "description": "Stop place id"
              },
              "name": {
                "$id": "#/properties/route/properties/stopPlaces/items/properties/name",
                "type": "string",
                "description": "Public name of stop"
              },
              "cancelled": {
                "$id": "#/properties/route/properties/stopPlaces/items/properties/cancelled",
                "type": "boolean",
                "description": "Indicated if the stop has been cancelled according to the original plan for the journey"
              },
              "location": {
                "$id": "#/properties/route/properties/stopPlaces/items/properties/location",
                "type": "object",
                "description": "Coordinates of stop place",
                "required": [
                  "latitude",
                  "longitude"
                ],
                "additionalProperties": true,
                "properties": {
                  "latitude": {
                    "$id": "#/properties/route/properties/stopPlaces/items/properties/location/properties/latitude",
                    "type": "number",
                    "description": "Latitude",
                    "minimum": -90.0000,
                    "maximum": 90.0000
                  },
                  "longitude": {
                    "$id": "#/properties/route/properties/stopPlaces/items/properties/location/properties/longitude",
                    "type": "number",
                    "description": "Longitude",
                    "minimum": -180.0000,
                    "maximum": 180.0000
                  }
                }
              },
              "tariffZones": {
                "$id": "#/properties/route/properties/stopPlaces/items/properties/tariffZones",
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "List of tariff zones for the specific stop."
              },
              "description": {
                "$id": "#/properties/route/properties/stopPlaces/items/properties/description",
                "type": "string",
                "description": "Description for travelers"
              },
              "publicCode": {
                "$id": "#/properties/route/properties/stopPlaces/items/properties/publicCode",
                "type": "string",
                "description": "Public code for a stop"
              }
            }
          }
        }
      }
    }
  }
}
