{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "ResourceHeader",
  "type": "object",
  "properties": {
    "content_hash": {
      "type": "string"
    },
    "dependencies": {
      "type": "array",
      "default": [],
      "items": {
        "$ref": "#/$defs/ResourceRef"
      }
    },
    "id": {
      "type": "string"
    },
    "kind": {
      "$ref": "#/$defs/ResourceKind"
    },
    "revision": {
      "type": "string"
    },
    "schema_version": {
      "type": "integer",
      "format": "uint32",
      "minimum": 0
    }
  },
  "required": [
    "id",
    "kind",
    "schema_version",
    "revision",
    "content_hash"
  ],
  "$defs": {
    "ResourceKind": {
      "type": "string",
      "enum": [
        "character",
        "world_book",
        "persona",
        "plot_module",
        "item_spec"
      ]
    },
    "ResourceRef": {
      "type": "object",
      "properties": {
        "content_hash": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "kind": {
          "$ref": "#/$defs/ResourceKind"
        },
        "revision": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "kind",
        "revision",
        "content_hash"
      ]
    }
  }
}
