{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Quoggle daily question handover",
  "type": "object",
  "required": [
    "schemaVersion",
    "day",
    "questions"
  ],
  "additionalProperties": false,
  "properties": {
    "schemaVersion": {
      "const": 1
    },
    "day": {
      "type": "string",
      "format": "date",
      "description": "Future UK Showdown date, YYYY-MM-DD."
    },
    "questions": {
      "type": "array",
      "minItems": 100,
      "maxItems": 100,
      "items": {
        "type": "object",
        "required": [
          "id",
          "category",
          "prompt",
          "answers",
          "correctIndex",
          "difficulty",
          "explanation",
          "sources"
        ],
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{1,80}$"
          },
          "category": {
            "enum": [
              "science",
              "sports",
              "general-knowledge",
              "tv-film",
              "music",
              "nature",
              "history"
            ]
          },
          "prompt": {
            "type": "string",
            "minLength": 1,
            "maxLength": 300
          },
          "answers": {
            "type": "array",
            "minItems": 4,
            "maxItems": 4,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 160
            }
          },
          "correctIndex": {
            "type": "integer",
            "minimum": 0,
            "maximum": 3
          },
          "difficulty": {
            "enum": [
              "easy",
              "medium",
              "hard"
            ]
          },
          "explanation": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "sources": {
            "type": "array",
            "minItems": 1,
            "maxItems": 5,
            "items": {
              "type": "string",
              "format": "uri",
              "pattern": "^https://"
            }
          }
        }
      }
    }
  }
}
