{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "EMPOWER-X Rulebook index",
  "type": "object",
  "required": [
    "id",
    "title",
    "version",
    "status",
    "chapters"
  ],
  "properties": {
    "id": {
      "type": "string",
      "format": "uri"
    },
    "title": {
      "type": "string"
    },
    "version": {
      "type": "string",
      "pattern": "^\\d+\\.\\d+$"
    },
    "status": {
      "enum": [
        "draft",
        "adopted",
        "superseded"
      ]
    },
    "generated": {
      "type": "string",
      "format": "date"
    },
    "chapters": {
      "type": "array",
      "minItems": 6,
      "maxItems": 6,
      "items": {
        "type": "object",
        "required": [
          "id",
          "title",
          "blueprintDimension",
          "topics"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^R[1-6]$"
          },
          "topics": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "id",
                "title",
                "inShort",
                "bindingText"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "pattern": "^R[1-6]\\.\\d+$"
                },
                "title": {
                  "type": "string"
                },
                "inShort": {
                  "type": "string",
                  "maxLength": 300
                },
                "bindingText": {
                  "type": "string",
                  "minLength": 20
                },
                "machineReadable": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
