{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://verio.dev/schema/document.schema.json",
  "title": "Document",
  "description": "A document this project writes: how it is laid out, and the project data it pulls in. The filename is the record id \u2014 SRS-001.yaml is SRS-001 \u2014 so the file never repeats its own name inside. A document is written in the editor rather than by hand, and is not part of the design: editing one changes how something reads, not what the device is, so it never appears in a comparison.",
  "type": "object",
  "properties": {
    "title": {
      "type": "string",
      "description": "What the document is called, in the tree and when it is picked."
    },
    "description": {
      "type": "string",
      "description": "What it is for, in a sentence."
    },
    "content": {
      "$ref": "#/$defs/node",
      "description": "The document itself, as the editor's node tree. A node of type verioField names something the project knows \u2014 its `source` is a field key such as count.requirements \u2014 and reads as that wherever the document is used; what is stored is the name, never the value."
    }
  },
  "required": [
    "title",
    "content"
  ],
  "additionalProperties": true,
  "$defs": {
    "node": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string"
        },
        "attrs": {
          "type": "object",
          "additionalProperties": true
        },
        "text": {
          "type": "string"
        },
        "marks": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": true
          }
        },
        "content": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/node"
          }
        }
      },
      "required": [
        "type"
      ],
      "additionalProperties": true
    }
  }
}
