{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://techcarbonstandard.org/schemas/index.json",
  "title": "Technology Carbon Standard Root Schema",
  "description": "Root schema that routes validation to the appropriate version of the Technology Carbon Standard",
  "type": "object",
  "properties": {
    "schema_version": {
      "type": "string",
      "description": "Version of the root Technology Carbon Standard report schema being used",
      "enum": ["0.1.2", "0.1.1", "0.1.0", "0.0.1"]
    }
  },
  "required": ["schema_version"],
  "allOf": [
    {
      "if": {
        "properties": {
          "schema_version": { "const": "0.1.2" }
        }
      },
      "then": {
        "$ref": "https://techcarbonstandard.org/schemas/reporting_organisation/v0.1.2.json"
      }
    },
    {
      "if": {
        "properties": {
          "schema_version": { "const": "0.1.1" }
        }
      },
      "then": {
        "$ref": "https://techcarbonstandard.org/schemas/reporting_organisation/v0.1.1.json"
      }
    },
    {
      "if": {
        "properties": {
          "schema_version": { "const": "0.1.0" }
        }
      },
      "then": {
        "$ref": "https://techcarbonstandard.org/schemas/reporting_organisation/v0.1.0.json"
      }
    },
    {
      "if": {
        "properties": {
          "schema_version": { "const": "0.0.1" }
        }
      },
      "then": {
        "$ref": "https://techcarbonstandard.org/schemas/reporting_organisation/v0.0.1.json"
      }
    }
  ],
  "additionalProperties": true
}