{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://redbook.fun/specification/1.0/schemas/context-descriptor.schema.json",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "minLength": 1
    },
    "kind": {
      "enum": [
        "reader",
        "redbook",
        "viewbox"
      ]
    },
    "label": {
      "type": "string"
    },
    "documentId": {
      "oneOf": [
        {
          "type": "string",
          "minLength": 1
        },
        {
          "type": "null"
        }
      ]
    },
    "instanceId": {
      "oneOf": [
        {
          "type": "string",
          "minLength": 1
        },
        {
          "type": "null"
        }
      ]
    },
    "roles": {
      "type": "array",
      "items": {
        "enum": [
          "reader-admin",
          "redbook-admin",
          "digital"
        ]
      }
    }
  },
  "required": [
    "id",
    "kind",
    "label",
    "documentId",
    "instanceId",
    "roles"
  ],
  "additionalProperties": false
}
