{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Hay registry index",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schemaVersion",
    "name",
    "plugins"
  ],
  "properties": {
    "schemaVersion": {
      "const": "hay.registry/1"
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 100
    },
    "plugins": {
      "type": "array",
      "maxItems": 100,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "manifest",
          "bundle"
        ],
        "properties": {
          "manifest": {
            "$ref": "manifest.schema.json"
          },
          "bundle": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "path",
              "sha256",
              "size"
            ],
            "properties": {
              "path": {
                "type": "string",
                "minLength": 1,
                "maxLength": 2048
              },
              "sha256": {
                "type": "string",
                "pattern": "^[a-f0-9]{64}$"
              },
              "size": {
                "type": "integer",
                "minimum": 1,
                "maximum": 2000000
              }
            }
          }
        }
      }
    }
  }
}
