{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.cume.tv/cume-channel.schema.json",
  "title": "CUME station discovery, version 1",
  "type": "object",
  "required": ["protocol", "version", "network", "optIn", "station", "channels"],
  "properties": {
    "protocol": {"const": "cume-channel"},
    "version": {"const": 1},
    "network": {"const": "CUME"},
    "optIn": {"type": "boolean"},
    "station": {"type": "object", "required": ["id", "name", "url", "description", "language", "relationship"], "properties": {
      "id": {"type": "string", "format": "uri", "pattern": "^https://"},
      "name": {"type": "string", "minLength": 1, "maxLength": 120},
      "url": {"type": "string", "format": "uri", "pattern": "^https://"},
      "description": {"type": "string", "minLength": 1, "maxLength": 1000},
      "language": {"type": "string", "minLength": 2},
      "relationship": {"enum": ["fan", "official"]}
    }},
    "channels": {"type": "array", "minItems": 1, "maxItems": 100, "items": {"type": "object", "required": ["id", "name", "watchUrl", "manifestUrl", "epochsUrl"], "properties": {
      "id": {"type": "string", "pattern": "^[a-zA-Z0-9_-]{1,80}$"},
      "name": {"type": "string", "minLength": 1, "maxLength": 120},
      "watchUrl": {"type": "string", "format": "uri", "pattern": "^https://"},
      "manifestUrl": {"type": "string", "format": "uri", "pattern": "^https://"},
      "epochsUrl": {"type": "string", "format": "uri", "pattern": "^https://"}
    }}}
  }
}
