{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/praetorium-gg/json-schema/praetorium-gg-reference-search-response-schema.json",
  "title": "ReferenceSearchResponse",
  "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/ReferenceSearchResponse",
  "type": "object",
  "properties": {
    "query": {
      "type": "string"
    },
    "results": {
      "maxItems": 25,
      "type": "array",
      "items": {
        "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"
          },
          "section": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "title": {
                "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",
              "url"
            ],
            "additionalProperties": false
          },
          "excerpt": {
            "type": "string",
            "maxLength": 322
          },
          "revisions": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            }
          },
          "attribution": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "id",
          "kind",
          "title",
          "faction",
          "url",
          "section",
          "excerpt",
          "revisions",
          "attribution"
        ],
        "additionalProperties": false
      }
    },
    "revisions": {
      "type": "object",
      "propertyNames": {
        "type": "string"
      },
      "additionalProperties": {
        "type": "string"
      }
    },
    "nextCursor": {
      "type": [
        "string",
        "null"
      ]
    }
  },
  "required": [
    "query",
    "results",
    "revisions",
    "nextCursor"
  ],
  "additionalProperties": false
}