{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://crawler-vault-marketing.web.app/schema/content-compendium.schema.json",
  "title": "Content compendium",
  "description": "A file of published content sharing one provenance: a rulebook's skills, a shop's gear. The pieces themselves are `contentDoc`s, the same shape a character's ledger snapshots.",
  "type": "object",
  "required": [
    "repo",
    "entries"
  ],
  "additionalProperties": false,
  "properties": {
    "repo": {
      "type": "string",
      "description": "The repository namespace refs into this file use. Matches the system's `id` for content shipped with a system."
    },
    "name": {
      "type": "string",
      "description": "What this collection is called: \"Gear\", \"Attack Skills\"."
    },
    "source": {
      "type": "string",
      "description": "Where the content came from, stated once for the file: \"Dungeon Crawler Carl Roleplaying Game, Core Rulebook\"."
    },
    "version": {
      "type": "string",
      "description": "Stamped onto every ref this file publishes, so a printing can be told from the one before it."
    },
    "description": {
      "type": "string",
      "description": "A sentence for a browser to show under the name."
    },
    "authors": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Who wrote it. A list, because packs get co-written and handed on."
    },
    "license": {
      "type": "string",
      "description": "An SPDX identifier where one fits: \"CC-BY-4.0\", \"MIT\". Blank leaves a pack's terms unstated, which is the wrong default for something meant to be passed on."
    },
    "licenseUrl": {
      "type": "string",
      "format": "uri",
      "description": "Where the licence is, for anything SPDX does not name."
    },
    "copyright": {
      "type": "string",
      "description": "The rights line, which is a different statement from the licence."
    },
    "system": {
      "type": "string",
      "description": "The system definition this content is written against, matching that definition's `id`. Paths and tags mean nothing against another game, and a pack that says which one it is for can be refused rather than reported as a hundred broken references."
    },
    "minSystemVersion": {
      "type": "string",
      "description": "The oldest system version this content is known to work with."
    },
    "entries": {
      "type": "array",
      "description": "The content, each with an id stable enough for a character to keep a reference to it.",
      "items": {
        "$ref": "#/$defs/entry"
      }
    }
  },
  "$defs": {
    "entry": {
      "type": "object",
      "required": [
        "id",
        "doc"
      ],
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "string",
          "description": "Unique within the file, and never changed once anything owns one."
        },
        "doc": {
          "$ref": "common.schema.json#/$defs/contentDoc"
        },
        "version": {
          "type": "string",
          "description": "This entry's own printing, where it has moved on from the file's. Absent means the file's, which is what a book printed whole says once for all of it."
        }
      }
    }
  }
}
