{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://data.events.opencampus.sh/v1/schema.json",
  "title": "opencampus Events Feed v1",
  "type": "object",
  "required": [
    "version",
    "timezone",
    "generated",
    "events"
  ],
  "properties": {
    "version": {
      "const": 1
    },
    "timezone": {
      "const": "Europe/Berlin"
    },
    "generated": {
      "type": "string",
      "format": "date-time"
    },
    "events": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/event"
      }
    }
  },
  "$defs": {
    "event": {
      "type": "object",
      "required": [
        "slug",
        "title",
        "date",
        "timezone",
        "category",
        "eventType",
        "channels",
        "source",
        "cancelled"
      ],
      "properties": {
        "slug": {
          "type": "string",
          "minLength": 1
        },
        "title": {
          "type": "string",
          "minLength": 1
        },
        "date": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
        },
        "time": {
          "type": "string",
          "pattern": "^\\d{2}:\\d{2}$"
        },
        "endDate": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
        },
        "endTime": {
          "type": "string",
          "pattern": "^\\d{2}:\\d{2}$"
        },
        "timezone": {
          "const": "Europe/Berlin"
        },
        "category": {
          "enum": [
            "konzert",
            "literatur",
            "bildung",
            "kultur",
            "workshop",
            "community"
          ]
        },
        "description": {
          "type": "string"
        },
        "location": {
          "type": "string"
        },
        "image": {
          "type": "string",
          "format": "uri"
        },
        "registerUrl": {
          "type": "string",
          "format": "uri"
        },
        "eventType": {
          "enum": [
            "ankuendigung",
            "ticketing"
          ]
        },
        "channels": {
          "type": "array",
          "items": {
            "enum": [
              "cobl",
              "makercube",
              "starterkitchen",
              "zentral"
            ]
          },
          "minItems": 1
        },
        "source": {
          "enum": [
            "intern",
            "extern"
          ]
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "region": {
          "type": "string"
        },
        "pretixOrganizer": {
          "type": "string"
        },
        "pretixEvent": {
          "type": "string"
        },
        "cancelled": {
          "type": "boolean"
        },
        "bodyHtml": {
          "type": "string"
        }
      }
    }
  }
}