{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "Message Schema",
  "description": "A schema for a message object or an array of message objects",
  "oneOf": [
    {
      "type": "object",
      "properties": {
        "valid-from": {
          "type": "string",
          "format": "date-time"
        },
        "valid-to": {
          "type": "string",
          "format": "date-time"
        },
        "version-from": {
          "type": "string",
          "pattern": "^\\d+\\.\\d+\\.\\d+$"
        },
        "version-to": {
          "type": "string",
          "pattern": "^\\d+\\.\\d+\\.\\d+$"
        },
        "message": {
          "type": "string"
        },
        "priority": {
          "type": "integer"
        }
      },
      "required": ["valid-from", "valid-to", "message", "priority"],
      "additionalProperties": false
    },
    {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "valid-from": {
            "type": "string",
            "format": "date-time"
          },
          "valid-to": {
            "type": "string",
            "format": "date-time"
          },
          "version-from": {
            "type": "string",
            "pattern": "^\\d+\\.\\d+\\.\\d+$"
          },
          "version-to": {
            "type": "string",
            "pattern": "^\\d+\\.\\d+\\.\\d+$"
          },
          "message": {
            "type": "string"
          },
          "priority": {
            "type": "integer"
          }
        },
        "required": ["valid-from", "valid-to", "message", "priority"],
        "additionalProperties": false
      }
    }
  ]
}

