{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://spec.super-arc.com/0.1.0/chapter.json",
  "title": "Chapter",
  "description": "A Chapter in the Narrative Spec. Required core is deliberately tiny: a stub is valid, and depth is scored rather than demanded. Depth groups are the optional top-level objects below; a group is started when its key is present and its value is a non-null object, including {}.",
  "type": "object",
  "required": [
    "id",
    "specType",
    "specVersion",
    "name",
    "num"
  ],
  "properties": {
    "id": {
      "$ref": "common.json#/$defs/id"
    },
    "specType": {
      "const": "chapter"
    },
    "specVersion": {
      "$ref": "common.json#/$defs/specVersion"
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "description": "Display name. May change; the slug in id may not."
    },
    "status": {
      "$ref": "common.json#/$defs/status"
    },
    "extensions": {
      "$ref": "common.json#/$defs/extensions"
    },
    "num": {
      "type": "string",
      "description": "Chapter number as displayed. String so \"0\" and \"12a\" both work."
    },
    "summary": {
      "type": [
        "object",
        "null"
      ],
      "description": "What happens, for someone who will not reread it.",
      "properties": {
        "text": {
          "type": "string"
        }
      }
    },
    "pov": {
      "type": [
        "object",
        "null"
      ],
      "description": "Whose head the reader is in.",
      "properties": {
        "character": {
          "$ref": "common.json#/$defs/ref"
        },
        "notes": {
          "type": "string"
        }
      }
    },
    "events": {
      "type": [
        "object",
        "null"
      ],
      "description": "In-world events this chapter dramatises.",
      "properties": {
        "events": {
          "type": "array",
          "items": {
            "$ref": "common.json#/$defs/ref"
          }
        }
      }
    },
    "function": {
      "type": [
        "object",
        "null"
      ],
      "description": "What this chapter does for the spine.",
      "properties": {
        "text": {
          "type": "string"
        }
      }
    }
  },
  "x-depthOrder": [
    "summary",
    "pov",
    "events",
    "function"
  ]
}
