{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://schemas.ferretlang.org/registry/artifact/category/v1.json",
  "title": "Ferret Registry Category Artifact v1",
  "description": "One category and its compact module references in a generated Ferret Registry distribution.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schemaVersion",
    "category",
    "modules"
  ],
  "properties": {
    "schemaVersion": {
      "const": 1
    },
    "category": {
      "$ref": "#/$defs/category"
    },
    "modules": {
      "type": "array",
      "minItems": 1,
      "uniqueItems": true,
      "items": {
        "$ref": "https://schemas.ferretlang.org/registry/artifact/module-index/v1.json#/$defs/moduleReference"
      }
    }
  },
  "$defs": {
    "category": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "name"
      ],
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
        },
        "name": {
          "type": "string",
          "minLength": 1,
          "pattern": "^[^\\r\\n]+$"
        }
      }
    }
  }
}
