{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://relativ-it.github.io/Butane-Schemas/Butane-Schema.json",
  "$comment": "Sources: https://github.com/Relativ-IT/Butane-Schemas/tree/Release",
  "title": "Fedora Coreos Butane Schema",
  "type": "object",
  "required": ["variant", "version"],

  "properties": {
    "variant": {
      "$id": "#/properties/variant",
      "type": "string",
      "title": "variant (string):",
      "description": "Used to differentiate configs for different operating systems.",
      "enum": [
         "fcos",
         "flatcar"
      ],
      "default": "fcos"
    },
    "version": {
      "$id": "#/properties/version",
      "type": "string",
      "title": "version (string):"
    }
  },
  "allOf": [
    {
      "oneOf": [
        {
          "properties": {
            "variant": {
              "const": "fcos"
            },
            "version": {
              "enum": [
                "1.4.0",
                "1.5.0",
                "1.6.0",
                "1.7.0"
              ],
              "default": "1.7.0"
            }
          }
        },
        {
          "properties": {
            "variant": {
              "const": "flatcar"
            },
            "version": {
              "enum": ["1.1.0"],
              "default": "1.1.0"
            }
          }
        }
      ]
    },
    {
      "oneOf": [
        {
          "allOf": [
            {
              "properties": {
                "variant": {
                  "const": "fcos"
                },
                "version": {
                  "const": "1.4.0"
                }
              }
            },
            {
              "$ref": "https://relativ-it.github.io/Butane-Schemas/v1.4.0/butane-v1.4.0.json"
            }
          ]
        },
        {
          "allOf": [
            {
              "properties": {
                "variant": {
                  "const": "fcos"
                },
                "version": {
                  "const": "1.5.0"
                }
              }
            },
            {
              "$ref": "https://relativ-it.github.io/Butane-Schemas/v1.5.0/butane-v1.5.0.json"
            }
          ]
        },
        {
          "allOf": [
            {
              "properties": {
                "variant": {
                  "const": "fcos"
                },
                "version": {
                  "const": "1.6.0"
                }
              }
            },
            {
              "$ref": "https://relativ-it.github.io/Butane-Schemas/v1.6.0/butane-v1.6.0.json"
            }
          ]
        },
        {
          "allOf": [
            {
              "properties": {
                "variant": {
                  "const": "fcos"
                },
                "version": {
                  "const": "1.7.0"
                }
              }
            },
            {
              "$ref": "https://relativ-it.github.io/Butane-Schemas/v1.7.0/butane-v1.7.0.json"
            }
          ]
        },
        {
          "allOf": [
            {
                "properties": {
                  "variant": {
                      "const": "flatcar"
                  },
                  "version": {
                      "const": "1.1.0"
                  }
                }
            },
            {
                "$ref": "https://relativ-it.github.io/Butane-Schemas/flatcar-v1.1.0/butane-flatcar-v1.1.0.json"
            }
          ]
        }
      ]
    }
  ]
}