{
  "$defs": {
    "Dependency": {
      "additionalProperties": false,
      "properties": {
        "archive_path": {
          "description": "The path in the downloaded archive where the binary is located. Default is ./<bin>",
          "type": "string"
        },
        "bin": {
          "description": "The name of the binary to be installed. Default is the name of the dependency.",
          "type": "string"
        },
        "description": {
          "description": "A description of the dependency. Informational only.",
          "type": "string"
        },
        "homepage": {
          "description": "The homepage for this dependency. Informational only.",
          "type": "string"
        },
        "link": {
          "description": "Whether to create a symlink to the bin instead of copying it.",
          "type": "boolean"
        },
        "overrides": {
          "description": "Overrides allows you to override values depending on the os and architecture of the target system.",
          "items": {
            "$ref": "#/$defs/DependencyOverride"
          },
          "type": "array"
        },
        "required_vars": {
          "description": "A list of variables that must be present for an install to succeed",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "substitutions": {
          "description": "Substitutions will substitute values from vars. The key is the name of the variable to substitute. The value is\na map of substitutions. { \"os\": { \"linux\": \"Linux\", \"darwin\": \"MacOS\" } } is an example of a substitution that\nwill update the os variable.",
          "patternProperties": {
            ".*": {
              "patternProperties": {
                ".*": {
                  "type": "string"
                }
              },
              "type": "object"
            }
          },
          "type": "object"
        },
        "systems": {
          "description": "List of systems this dependency supports. Systems are in the form of os/architecture.",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "template": {
          "description": "A template for this dependency. Value is the name of a template in the templates section of this config.\nAny unset fields in this dependency will be set by values from the template. Overrides in the dependency\nand its template are concatenated with the template's overrides coming first. Vars and substitutions\nare both combined with the dependency's value taking precedence.",
          "type": "string"
        },
        "url": {
          "description": "The url to download a dependency from.",
          "type": "string"
        },
        "vars": {
          "description": "A list of variables that can be used in 'url', 'archive_path' and 'bin'.\n\nTwo variables are always added based on the current environment: 'os' and 'arch'. Those are the operating\nsystem and architecture as defined by go's GOOS and GOARCH variables. I should document what those are\nsomewhere.\n\nYou can reference a variable using golang template syntax. For example, you could have a url set to\n`https://example.org/mydependency/v{{.version}}/mydependency-{{.os}}-{{.arch}}.tar.gz`.  If you define the var\n'version: 1.2.3' and run bindown on a 64-bit Linux system, it will download\n`https://example.org/mydependency/v1.2.3/mydependency-linux-amd64.tar.gz`.",
          "patternProperties": {
            ".*": {
              "type": "string"
            }
          },
          "type": "object"
        }
      },
      "type": "object"
    },
    "DependencyOverride": {
      "additionalProperties": false,
      "properties": {
        "dependency": {
          "$ref": "#/$defs/Overrideable",
          "description": "Values to override the parent dependency"
        },
        "matcher": {
          "description": "Limits the override to configurations matching all of the matchers. Keys may be \"os\", \"arch\" or any variable name.\nValues are an array of values to match. Any matching value will match. If a value can be interpreted as a\nsemantic version it will be treated as such.",
          "patternProperties": {
            ".*": {
              "items": {
                "type": "string"
              },
              "type": "array"
            }
          },
          "type": "object"
        }
      },
      "required": [
        "matcher",
        "dependency"
      ],
      "type": "object"
    },
    "Overrideable": {
      "additionalProperties": false,
      "properties": {
        "archive_path": {
          "description": "The path in the downloaded archive where the binary is located. Default is ./<bin>",
          "type": "string"
        },
        "bin": {
          "description": "The name of the binary to be installed. Default is the name of the dependency.",
          "type": "string"
        },
        "link": {
          "description": "Whether to create a symlink to the bin instead of copying it.",
          "type": "boolean"
        },
        "overrides": {
          "description": "Overrides allows you to override values depending on the os and architecture of the target system.",
          "items": {
            "$ref": "#/$defs/DependencyOverride"
          },
          "type": "array"
        },
        "substitutions": {
          "description": "Substitutions will substitute values from vars. The key is the name of the variable to substitute. The value is\na map of substitutions. { \"os\": { \"linux\": \"Linux\", \"darwin\": \"MacOS\" } } is an example of a substitution that\nwill update the os variable.",
          "patternProperties": {
            ".*": {
              "patternProperties": {
                ".*": {
                  "type": "string"
                }
              },
              "type": "object"
            }
          },
          "type": "object"
        },
        "url": {
          "description": "The url to download a dependency from.",
          "type": "string"
        },
        "vars": {
          "description": "A list of variables that can be used in 'url', 'archive_path' and 'bin'.\n\nTwo variables are always added based on the current environment: 'os' and 'arch'. Those are the operating\nsystem and architecture as defined by go's GOOS and GOARCH variables. I should document what those are\nsomewhere.\n\nYou can reference a variable using golang template syntax. For example, you could have a url set to\n`https://example.org/mydependency/v{{.version}}/mydependency-{{.os}}-{{.arch}}.tar.gz`.  If you define the var\n'version: 1.2.3' and run bindown on a 64-bit Linux system, it will download\n`https://example.org/mydependency/v1.2.3/mydependency-linux-amd64.tar.gz`.",
          "patternProperties": {
            ".*": {
              "type": "string"
            }
          },
          "type": "object"
        }
      },
      "type": "object"
    }
  },
  "$id": "https://willabides.github.io/bindown/bindown.schema.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "properties": {
    "cache": {
      "description": "The directory where bindown will cache downloads and extracted files. This is relative to the directory where\nthe configuration file resides. cache paths should always use / as a delimiter even on Windows or other\noperating systems where the native delimiter isn't /.",
      "type": "string"
    },
    "dependencies": {
      "description": "Dependencies available for bindown to install.",
      "patternProperties": {
        ".*": {
          "$ref": "#/$defs/Dependency"
        }
      },
      "type": "object"
    },
    "install_dir": {
      "description": "The directory that bindown installs files to. This is relative to the directory where the configuration file\nresides. install_directory paths should always use / as a delimiter even on Windows or other operating systems\nwhere the native delimiter isn't /.",
      "type": "string"
    },
    "systems": {
      "description": "List of systems supported by this config. Systems are in the form of os/architecture.",
      "items": {
        "type": "string"
      },
      "type": "array"
    },
    "template_sources": {
      "description": "Upstream sources for templates.",
      "patternProperties": {
        ".*": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "templates": {
      "description": "Templates that can be used by dependencies in this file.",
      "patternProperties": {
        ".*": {
          "$ref": "#/$defs/Dependency"
        }
      },
      "type": "object"
    },
    "url_checksums": {
      "description": "Checksums of downloaded files.",
      "patternProperties": {
        ".*": {
          "type": "string"
        }
      },
      "type": "object"
    }
  },
  "type": "object"
}