{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "type": {
      "type": "string",
      "const": "message"
    },
    "data": {
      "type": "object",
      "properties": {
        "version": {
          "type": "number",
          "const": 1
        },
        "chatRef": {
          "type": "string",
          "minLength": 1,
          "description": "The platform's own id of the chat, as the platform sent it."
        },
        "kind": {
          "type": "string",
          "enum": [
            "reply",
            "notice"
          ]
        },
        "language": {
          "type": "string",
          "minLength": 2
        },
        "blocks": {
          "minItems": 1,
          "type": "array",
          "items": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "text"
                  },
                  "text": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "type",
                  "text"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "quote"
                  },
                  "text": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "type",
                  "text"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "source"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1
                  },
                  "url": {
                    "type": "string",
                    "format": "uri"
                  },
                  "at": {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                  }
                },
                "required": [
                  "type",
                  "name",
                  "at"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "list"
                  },
                  "title": {
                    "type": "string",
                    "minLength": 1
                  },
                  "items": {
                    "minItems": 1,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1
                    }
                  }
                },
                "required": [
                  "type",
                  "title",
                  "items"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "proposal"
                  },
                  "statement": {
                    "type": "string",
                    "minLength": 1
                  },
                  "sources": {
                    "minItems": 1,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1
                    }
                  }
                },
                "required": [
                  "type",
                  "statement",
                  "sources"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "choices"
                  },
                  "options": {
                    "minItems": 1,
                    "maxItems": 3,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "minLength": 1
                        },
                        "label": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 20
                        }
                      },
                      "required": [
                        "id",
                        "label"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "required": [
                  "type",
                  "options"
                ],
                "additionalProperties": false
              }
            ]
          }
        },
        "replyTo": {
          "type": "string",
          "minLength": 1
        }
      },
      "required": [
        "version",
        "chatRef",
        "kind",
        "language",
        "blocks"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "type",
    "data"
  ],
  "additionalProperties": false,
  "description": "Venndann message, version 1"
}
