{
  "$ref": "#/definitions/host-to-widget",
  "definitions": {
    "host-to-widget": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "ocp.setContext"
            },
            "context": {
              "type": "object",
              "properties": {
                "url": {
                  "type": "string"
                },
                "title": {
                  "type": "string"
                },
                "description": {
                  "type": "string"
                },
                "selection": {
                  "type": "string",
                  "maxLength": 8192
                },
                "resource": {
                  "type": "object",
                  "properties": {
                    "kind": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "title": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "kind",
                    "id"
                  ],
                  "additionalProperties": false
                }
              },
              "additionalProperties": false
            }
          },
          "required": [
            "type",
            "context"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "ocp.open"
            }
          },
          "required": [
            "type"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "ocp.close"
            }
          },
          "required": [
            "type"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "ocp.identify"
            },
            "visitorJws": {
              "type": "string",
              "minLength": 20
            }
          },
          "required": [
            "type",
            "visitorJws"
          ],
          "additionalProperties": false
        }
      ]
    }
  },
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://schwaizer.ch/ocp/schemas/1.0/host-to-widget.json"
}
