{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://hushspec.dev/schemas/hushspec-registry-action-types.v0.schema.json",
  "title": "HushSpec Action-Type Registry v0",
  "description": "Shape of spec/registries/action-types.yaml.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "registry",
    "registry_version",
    "status",
    "entries"
  ],
  "properties": {
    "registry": {
      "const": "action-types"
    },
    "registry_version": {
      "type": "string",
      "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+$"
    },
    "status": {
      "type": "string",
      "enum": [
        "closed",
        "open"
      ]
    },
    "entries": {
      "type": "array",
      "minItems": 1,
      "uniqueItems": true,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "summary",
          "rule_blocks",
          "spec"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)*$"
          },
          "summary": {
            "type": "string",
            "minLength": 1
          },
          "rule_blocks": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)*$"
            },
            "uniqueItems": true
          },
          "required_capability": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)*$"
          },
          "spec": {
            "type": "string",
            "minLength": 1,
            "description": "The defining specification and section, for example `core 3.4`."
          },
          "notes": {
            "type": "string"
          }
        }
      }
    }
  }
}
