{
  "$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v3.6.0/schemas/shared-scenario.schema.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "minLength": 1,
      "maxLength": 512
    },
    "actor": {
      "type": "string",
      "maxLength": 256
    },
    "date": {
      "type": "string",
      "maxLength": 64
    },
    "controls": {
      "type": "object",
      "propertyNames": {
        "$ref": "#/$defs/__schema0"
      },
      "additionalProperties": {
        "$ref": "#/$defs/__schema1"
      }
    },
    "state": {
      "$ref": "#/$defs/__schema2"
    },
    "flags": {
      "maxItems": 10000,
      "type": "array",
      "items": {
        "$ref": "#/$defs/__schema6"
      }
    },
    "eventTargets": {
      "type": "object",
      "propertyNames": {
        "type": "string",
        "maxLength": 512
      },
      "additionalProperties": {
        "type": "string",
        "maxLength": 512
      }
    },
    "scopes": {
      "type": "object",
      "propertyNames": {
        "$ref": "#/$defs/__schema7"
      },
      "additionalProperties": {
        "$ref": "#/$defs/__schema8"
      }
    },
    "candidateOverrides": {
      "type": "object",
      "propertyNames": {
        "type": "string",
        "maxLength": 512
      },
      "additionalProperties": {
        "type": "boolean"
      }
    },
    "closedFlags": {
      "type": "boolean"
    },
    "schemaVersion": {
      "type": "string",
      "const": "1.0"
    },
    "globalFlags": {
      "maxItems": 10000,
      "type": "array",
      "items": {
        "$ref": "#/$defs/__schema10"
      }
    },
    "scopeCatalogs": {
      "type": "object",
      "propertyNames": {
        "$ref": "#/$defs/__schema10"
      },
      "additionalProperties": {
        "type": "object",
        "properties": {
          "complete": {
            "type": "boolean"
          },
          "members": {
            "maxItems": 2048,
            "type": "array",
            "items": {
              "$ref": "#/$defs/__schema10"
            }
          }
        },
        "required": [
          "complete",
          "members"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "id",
    "state",
    "schemaVersion"
  ],
  "additionalProperties": false,
  "$defs": {
    "__schema0": {
      "type": "string",
      "pattern": "^[1-9][0-9]{0,8}$"
    },
    "__schema1": {
      "type": "string",
      "pattern": "^[A-Z0-9]{3}$"
    },
    "__schema2": {
      "type": "object",
      "propertyNames": {
        "$ref": "#/$defs/__schema3"
      },
      "additionalProperties": {
        "$ref": "#/$defs/__schema4"
      }
    },
    "__schema3": {
      "type": "string",
      "minLength": 1,
      "maxLength": 1024
    },
    "__schema4": {
      "anyOf": [
        {
          "$ref": "#/$defs/__schema5"
        },
        {
          "maxItems": 10000,
          "type": "array",
          "items": {
            "$ref": "#/$defs/__schema5"
          }
        }
      ]
    },
    "__schema5": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 4096
        },
        {
          "type": "number"
        },
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ]
    },
    "__schema6": {
      "type": "string",
      "minLength": 1,
      "maxLength": 512
    },
    "__schema7": {
      "type": "string",
      "minLength": 1,
      "maxLength": 128
    },
    "__schema8": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512
        },
        "type": {
          "type": "string",
          "enum": [
            "country",
            "state",
            "character",
            "unit_leader",
            "operative",
            "strategic_region",
            "province",
            "unknown"
          ]
        },
        "actor": {
          "type": "string",
          "maxLength": 256
        },
        "state": {
          "$ref": "#/$defs/__schema2"
        },
        "flags": {
          "maxItems": 10000,
          "type": "array",
          "items": {
            "$ref": "#/$defs/__schema9"
          }
        },
        "eventTargets": {
          "type": "object",
          "propertyNames": {
            "type": "string",
            "maxLength": 512
          },
          "additionalProperties": {
            "type": "string",
            "maxLength": 512
          }
        },
        "weight": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "string",
              "maxLength": 1024
            }
          ]
        }
      },
      "required": [
        "id",
        "state"
      ],
      "additionalProperties": false
    },
    "__schema9": {
      "type": "string",
      "minLength": 1,
      "maxLength": 512
    },
    "__schema10": {
      "type": "string",
      "minLength": 1,
      "maxLength": 512
    }
  }
}
