{
  "$ref": "#/definitions/widget-to-host",
  "definitions": {
    "widget-to-host": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "ocp.ready"
            }
          },
          "required": [
            "type"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "ocp.state"
            },
            "phase": {
              "type": "string",
              "enum": [
                "idle",
                "connecting",
                "live",
                "error"
              ]
            }
          },
          "required": [
            "type",
            "phase"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "ocp.event"
            },
            "name": {
              "type": "string",
              "maxLength": 64
            },
            "data": {
              "type": "object",
              "additionalProperties": {}
            }
          },
          "required": [
            "type",
            "name"
          ],
          "additionalProperties": false
        }
      ]
    }
  },
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://schwaizer.ch/ocp/schemas/1.0/widget-to-host.json"
}
