{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://raw.githubusercontent.com/shivammathur/setup-php/develop/src/configs/tools_schema.json",
  "type": "object",
  "title": "Tools",
  "default": {},
  "examples": [
    {
      "tool": {
        "alias": "tool_alias",
        "domain": "https://example.com",
        "extension": ".ext",
        "fetch_latest": "true",
        "function": "function_name",
        "repository": "user/tool",
        "packagist": "user/tool",
        "scope": "global, scoped",
        "type": "phar, composer, custom-package or custom-function",
        "version_parameter": "--version",
        "version_prefix": "v"
      }
    }
  ],
  "items": {
    "properties": {
      "alias": {
        "$id": "#/items/properties/alias",
        "type": "string",
        "title": "The alias schema",
        "description": "Alias for a tool.",
        "examples": [
          "tool_alias"
        ]
      },
      "domain": {
        "$id": "#/items/properties/domain",
        "type": "string",
        "title": "The domain schema",
        "description": "Domain URL of the tool.",
        "examples": [
          "https://example.com"
        ]
      },
      "extension": {
        "$id": "#/items/properties/extension",
        "type": "string",
        "title": "The extension schema",
        "description": "File extension of the tool.",
        "examples": [
          ".ext"
        ]
      },
      "fetch_latest": {
        "$id": "#/items/properties/fetch_latest",
        "type": "string",
        "title": "The fetch_latest schema",
        "description": "Fetch the latest version from GitHub releases.",
        "enum": [
          "true",
          "false"
        ]
      },
      "function": {
        "$id": "#/items/properties/function",
        "type": "string",
        "title": "The function schema",
        "description": "Function name in tools.ts which returns the script to setup the tool.",
        "examples": [
          "function_name"
        ]
      },
      "repository": {
        "$id": "#/items/properties/repository",
        "type": "string",
        "title": "The repository schema",
        "description": "GitHub repository of the tool.",
        "examples": [
          "user/tool"
        ]
      },
      "packagist": {
        "$id": "#/items/properties/packagist",
        "type": "string",
        "title": "The repository schema",
        "description": "Packagist repository of the tool in case different from repository.",
        "examples": [
          "user/tool"
        ]
      },
      "scope": {
        "$id": "#/items/properties/scope",
        "type": "string",
        "title": "The scope schema",
        "description": "Scope of tool installation: global or scoped",
        "enum": [
          "global",
          "scoped"
        ]
      },
      "type": {
        "$id": "#/items/properties/type",
        "type": "string",
        "title": "The type schema",
        "description": "Type of tool: phar, composer, custom-package or custom-function.",
        "enum": [
          "phar",
          "composer",
          "custom-package",
          "custom-function"
        ]
      },
      "version_parameter": {
        "$id": "#/items/properties/version_parameter",
        "type": "string",
        "title": "The version_parameter schema",
        "description": "Parameter to get the tool version.",
        "examples": [
          "--version"
        ]
      },
      "version_prefix": {
        "$id": "#/items/properties/version_prefix",
        "type": "string",
        "title": "The version_prefix schema",
        "description": "Prefix of the version in the download URL.",
        "examples": [
          "v"
        ]
      }
    },
    "required": [
      "type"
    ],
    "additionalProperties": true
  }
}