{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://glass.spboucher.ai/registry/schema/registry.schema.json",
  "title": "SP Glass Registry index (registry.json)",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schemaVersion",
    "name",
    "homepage",
    "license",
    "items",
    "themes"
  ],
  "properties": {
    "schemaVersion": {
      "const": 1
    },
    "name": {
      "type": "string"
    },
    "homepage": {
      "type": "string"
    },
    "license": {
      "type": "string"
    },
    "items": {
      "type": "array",
      "maxItems": 512,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "kind",
          "summary",
          "latest",
          "versions"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$",
            "maxLength": 64
          },
          "name": {
            "type": "string",
            "maxLength": 80
          },
          "kind": {
            "enum": [
              "native-wrapper",
              "custom-glass",
              "content-component",
              "primitive",
              "theme"
            ]
          },
          "category": {
            "type": "string"
          },
          "summary": {
            "type": "string",
            "maxLength": 600
          },
          "latest": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)(-[0-9A-Za-z]+(\\.[0-9A-Za-z]+)*)?$",
            "maxLength": 64
          },
          "versions": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "version",
                "path",
                "sha256"
              ],
              "properties": {
                "version": {
                  "type": "string",
                  "pattern": "^(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)(-[0-9A-Za-z]+(\\.[0-9A-Za-z]+)*)?$",
                  "maxLength": 64
                },
                "path": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 240,
                  "pattern": "^(?!/)(?!~)(?!.*(^|/)\\.)(?!.*//)[A-Za-z0-9+_. /-]+$",
                  "description": "Relative path with forward slashes. No component may be empty, start with a dot, or be '.' or '..'."
                },
                "sha256": {
                  "type": "string",
                  "pattern": "^[0-9a-f]{64}$"
                }
              }
            }
          }
        }
      }
    },
    "themes": {
      "type": "array",
      "maxItems": 512,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "kind",
          "summary",
          "latest",
          "versions"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$",
            "maxLength": 64
          },
          "name": {
            "type": "string",
            "maxLength": 80
          },
          "kind": {
            "enum": [
              "native-wrapper",
              "custom-glass",
              "content-component",
              "primitive",
              "theme"
            ]
          },
          "category": {
            "type": "string"
          },
          "summary": {
            "type": "string",
            "maxLength": 600
          },
          "latest": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)(-[0-9A-Za-z]+(\\.[0-9A-Za-z]+)*)?$",
            "maxLength": 64
          },
          "versions": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "version",
                "path",
                "sha256"
              ],
              "properties": {
                "version": {
                  "type": "string",
                  "pattern": "^(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)(-[0-9A-Za-z]+(\\.[0-9A-Za-z]+)*)?$",
                  "maxLength": 64
                },
                "path": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 240,
                  "pattern": "^(?!/)(?!~)(?!.*(^|/)\\.)(?!.*//)[A-Za-z0-9+_. /-]+$",
                  "description": "Relative path with forward slashes. No component may be empty, start with a dot, or be '.' or '..'."
                },
                "sha256": {
                  "type": "string",
                  "pattern": "^[0-9a-f]{64}$"
                }
              }
            }
          }
        }
      }
    }
  }
}
