{
  "$defs": {
    "RawAnticipatedConfig": {
      "additionalProperties": false,
      "description": "Intermediate type for anticipated dispatch configuration.",
      "properties": {
        "lead_stages": {
          "description": "Number of stages of dispatch anticipation. Must be ≥ 1.\n\nUsing `u32` here causes serde to reject negative JSON literals with a\n`ParseError` before validation runs.",
          "format": "uint32",
          "minimum": 0,
          "type": "integer"
        }
      },
      "required": [
        "lead_stages"
      ],
      "type": "object"
    },
    "RawThermal": {
      "additionalProperties": false,
      "description": "Intermediate type for a single thermal plant entry.",
      "properties": {
        "anticipated_config": {
          "anyOf": [
            {
              "$ref": "#/$defs/RawAnticipatedConfig"
            },
            {
              "type": "null"
            }
          ],
          "description": "Anticipated dispatch configuration. Absent = no anticipation."
        },
        "bus_id": {
          "description": "Bus to which this plant's generation is injected.",
          "format": "int32",
          "type": "integer"
        },
        "cost_per_mwh": {
          "description": "Marginal cost of generation [$/`MWh`]. Must be ≥ 0.0.",
          "format": "double",
          "type": "number"
        },
        "entry_stage_id": {
          "default": null,
          "description": "Stage index when the plant enters service. Absent or null = always exists.",
          "format": "int32",
          "type": [
            "integer",
            "null"
          ]
        },
        "exit_stage_id": {
          "default": null,
          "description": "Stage index when the plant is decommissioned. Absent or null = never.",
          "format": "int32",
          "type": [
            "integer",
            "null"
          ]
        },
        "generation": {
          "$ref": "#/$defs/RawThermalGeneration",
          "description": "Generation bounds."
        },
        "id": {
          "description": "Thermal plant identifier. Must be unique within the file.",
          "format": "int32",
          "type": "integer"
        },
        "name": {
          "description": "Human-readable plant name.",
          "type": "string"
        }
      },
      "required": [
        "id",
        "name",
        "bus_id",
        "cost_per_mwh",
        "generation"
      ],
      "type": "object"
    },
    "RawThermalGeneration": {
      "additionalProperties": false,
      "description": "Intermediate type for the generation bounds sub-object.",
      "properties": {
        "max_mw": {
          "description": "Maximum generation (installed capacity) [MW].",
          "format": "double",
          "type": "number"
        },
        "min_mw": {
          "description": "Minimum generation (minimum stable load) [MW].",
          "format": "double",
          "type": "number"
        }
      },
      "required": [
        "min_mw",
        "max_mw"
      ],
      "type": "object"
    }
  },
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "description": "Top-level intermediate type for `thermals.json` (serde only, not re-exported).",
  "properties": {
    "$schema": {
      "description": "`$schema` field — informational, not validated.",
      "type": [
        "string",
        "null"
      ]
    },
    "thermals": {
      "description": "Array of thermal plant entries.",
      "items": {
        "$ref": "#/$defs/RawThermal"
      },
      "type": "array"
    }
  },
  "required": [
    "thermals"
  ],
  "title": "RawThermalFile",
  "type": "object"
}