{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/praetorium-gg/json-schema/praetorium-gg-reference-document-schema.json",
  "title": "ReferenceDocument",
  "x-generated": "2026-11-21",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/praetorium-gg-v1-openapi.json#/components/schemas/ReferenceDocument",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "enum": [
        "datasheet",
        "deployment",
        "detachment",
        "disposition",
        "mission",
        "rule",
        "terrain"
      ]
    },
    "title": {
      "type": "string"
    },
    "faction": {
      "type": [
        "string",
        "null"
      ]
    },
    "url": {
      "type": "string"
    },
    "sections": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "text": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "textSources": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "source": {
                  "type": "string",
                  "enum": [
                    "bsdata",
                    "game-datacards"
                  ]
                },
                "url": {
                  "type": "string",
                  "format": "uri"
                },
                "id": {
                  "type": "string"
                }
              },
              "required": [
                "source",
                "url"
              ],
              "additionalProperties": false
            },
            "description": "Where withheld rules text lives upstream: the pinned file, its source, and the id of the record holding it there when the file has one. Fetch it there if you need the wording."
          }
        },
        "required": [
          "id",
          "title",
          "text",
          "url"
        ],
        "additionalProperties": false
      }
    },
    "revisions": {
      "type": "object",
      "propertyNames": {
        "type": "string"
      },
      "additionalProperties": {
        "type": "string"
      }
    },
    "attribution": {
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  },
  "required": [
    "id",
    "kind",
    "title",
    "faction",
    "url",
    "sections",
    "revisions",
    "attribution"
  ],
  "additionalProperties": false
}