{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://library.mrm.org/schema/collection.schema.json",
  "title": "Collection record (data/collections/<slug>.yaml)",
  "description": "A curated, many-to-many grouping of works. Works join with `collections:` in their index.md. Replaces the old 'shelves'.",
  "type": "object",
  "required": [
    "title"
  ],
  "additionalProperties": false,
  "properties": {
    "title": {
      "type": "string",
      "minLength": 1
    },
    "description": {
      "type": "string"
    },
    "kind": {
      "enum": [
        "collection",
        "series"
      ],
      "default": "collection"
    },
    "order": {
      "type": "number"
    },
    "image": {
      "type": "string"
    },
    "include": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "author": {
          "$ref": "https://library.mrm.org/schema/common.schema.json#/$defs/slug"
        },
        "topic": {
          "$ref": "https://library.mrm.org/schema/common.schema.json#/$defs/slug"
        },
        "type": {
          "type": "string"
        }
      },
      "description": "Automatic membership rule."
    }
  }
}
