{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "http://schema.ruter.no/arriving.json",
  "type": "object",
  "title": "Arriving MQTT Message",
  "description": "For display of arriving information to passengers",
  "required": [
    "eventTimestamp",
    "message"
  ],
  "additionalProperties": false,
  "properties": {
    "eventTimestamp": {
      "$id": "#/properties/eventTimestamp",
      "type": "string",
      "description": "Event timestamp must be ISO 8601 UTC",
      "format": "date-time"
    },
    "expiryTimestamp": {
      "$id": "#/properties/expiryimestamp",
      "type": "string",
      "description": "Expiry timestamp must be ISO 8601 UTC, do not play or display after",
      "format": "date-time"
    },
    "ref": {
      "$id": "#/properties/ref",
      "type": "string",
      "description": "Reference to stop place id"
    },
    "message": {
      "$id": "#/properties/message",
      "type": "object",
      "description": "Message for one or more language",
      "additionalProperties": false,
      "patternProperties": {
        "^[a-z]{2}(-[a-z]{2})?$": {
          "$id": "#/properties/message/patternProperties/multilingualMessage",
          "type": "object",
          "description": "A multilingual message",
          "additionalProperties": false,
          "properties": {
            "title": {
              "$id": "#/properties/message/patternProperties/multilingualMessage/properties/title",
              "type": "string",
              "description": "Title"
            },
            "text": {
              "$id": "#/properties/message/patternProperties/multilingualMessage/properties/text",
              "type": "string",
              "description": "Body text"
            }
          }
        }
      }
    },
    "zoneId": {
      "$id": "#/properties/zoneId",
      "type": "string",
      "description": "Fare zone of next stop"
    }
  }
}