{
  "$defs": {
    "RawLine": {
      "additionalProperties": false,
      "description": "Intermediate type for a single line entry.",
      "properties": {
        "capacity": {
          "$ref": "#/$defs/RawLineCapacity",
          "description": "Nested capacity object with direct and reverse MW limits."
        },
        "entry_stage_id": {
          "default": null,
          "description": "Stage index when the line enters service. Absent or null = always exists.",
          "format": "int32",
          "type": [
            "integer",
            "null"
          ]
        },
        "exchange_cost": {
          "default": null,
          "description": "Optional entity-level exchange cost override [$/`MWh`].\nWhen absent, falls back to global `line_exchange_cost`.",
          "format": "double",
          "type": [
            "number",
            "null"
          ]
        },
        "exit_stage_id": {
          "default": null,
          "description": "Stage index when the line is decommissioned. Absent or null = never.",
          "format": "int32",
          "type": [
            "integer",
            "null"
          ]
        },
        "id": {
          "description": "Line identifier. Must be unique within the file.",
          "format": "int32",
          "type": "integer"
        },
        "losses_percent": {
          "default": 0.0,
          "description": "Transmission losses as percentage. Defaults to 0.0 when absent.",
          "format": "double",
          "type": "number"
        },
        "name": {
          "description": "Human-readable line name.",
          "type": "string"
        },
        "source_bus_id": {
          "description": "Source bus identifier.",
          "format": "int32",
          "type": "integer"
        },
        "target_bus_id": {
          "description": "Target bus identifier.",
          "format": "int32",
          "type": "integer"
        }
      },
      "required": [
        "id",
        "name",
        "source_bus_id",
        "target_bus_id",
        "capacity"
      ],
      "type": "object"
    },
    "RawLineCapacity": {
      "additionalProperties": false,
      "description": "Intermediate type for the nested capacity sub-object.",
      "properties": {
        "direct_mw": {
          "description": "Maximum flow from source to target [MW].",
          "format": "double",
          "type": "number"
        },
        "reverse_mw": {
          "description": "Maximum flow from target to source [MW].",
          "format": "double",
          "type": "number"
        }
      },
      "required": [
        "direct_mw",
        "reverse_mw"
      ],
      "type": "object"
    }
  },
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "description": "Top-level intermediate type for `lines.json` (serde only, not re-exported).",
  "properties": {
    "$schema": {
      "description": "`$schema` field — informational, not validated.",
      "type": [
        "string",
        "null"
      ]
    },
    "lines": {
      "description": "Array of line entries.",
      "items": {
        "$ref": "#/$defs/RawLine"
      },
      "type": "array"
    }
  },
  "required": [
    "lines"
  ],
  "title": "RawLineFile",
  "type": "object"
}