{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/praetorium-gg/json-schema/praetorium-gg-detachment-record-schema.json",
  "title": "DetachmentRecord",
  "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/DetachmentRecord",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "kind": {
      "type": "string",
      "const": "detachment"
    },
    "canonicalUrl": {
      "type": "string"
    },
    "revisions": {
      "$ref": "#/$defs/Revisions"
    },
    "attribution": {
      "$ref": "#/$defs/Attribution"
    },
    "data": {
      "$ref": "#/$defs/Detachment"
    }
  },
  "required": [
    "kind",
    "canonicalUrl",
    "revisions",
    "attribution",
    "data"
  ],
  "$defs": {
    "Attribution": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "Detachment": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "catalogueId": {
          "type": "string"
        },
        "faction": {
          "type": "string"
        },
        "factionSlug": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "slug": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "points": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ]
        },
        "dispositions": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "rules": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/NamedRule"
          }
        },
        "enhancements": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/PointedRule"
          }
        },
        "upgrades": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/PointedRule"
          }
        },
        "stratagems": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Stratagem"
          }
        },
        "keywordRules": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/KeywordRule"
          }
        },
        "attribution": {
          "type": "string"
        },
        "provenance": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "definitions": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "revision": {
                  "type": "string"
                },
                "detachmentId": {
                  "type": "string"
                }
              },
              "required": [
                "revision",
                "detachmentId"
              ]
            },
            "rules": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "revision": {
                  "type": "string"
                }
              },
              "required": [
                "revision"
              ]
            },
            "datacards": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "revision": {
                  "type": "string"
                }
              },
              "required": [
                "revision"
              ]
            }
          },
          "required": [
            "definitions",
            "rules",
            "datacards"
          ]
        }
      },
      "required": [
        "catalogueId",
        "faction",
        "factionSlug",
        "id",
        "slug",
        "name",
        "points",
        "dispositions",
        "rules",
        "enhancements",
        "upgrades",
        "stratagems",
        "keywordRules",
        "attribution",
        "provenance"
      ]
    },
    "KeywordRule": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        }
      },
      "required": [
        "name",
        "description"
      ]
    },
    "NamedRule": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "name": {
          "type": "string"
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "name",
        "description"
      ]
    },
    "PointedRule": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "name": {
          "type": "string"
        },
        "points": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ]
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "name",
        "points",
        "description"
      ]
    },
    "Revisions": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      }
    },
    "Stratagem": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "cp": {
          "type": "integer"
        },
        "type": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "phases": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "turn": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "id",
        "name",
        "cp",
        "type",
        "phases",
        "turn",
        "description"
      ]
    }
  }
}