{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://catalog.lintel.tools/schemas/schemastore/vim-addon-info/latest.json",
  "title": "JSON schema for vim plugin addon-info.json metadata files",
  "x-lintel": {
    "source": "https://www.schemastore.org/vim-addon-info.json",
    "sourceSha256": "25447ed8db10494466d582ff6ead6bd7c2fc4780f48a9a217e7b6ea63b09dfa9",
    "fileMatch": [
      "**/*vim*/addon-info.json"
    ],
    "parsers": [
      "json"
    ]
  },
  "type": "object",
  "properties": {
    "name": {
      "description": "The name of the plugin. Used by plugin managers and some introspection tools. Generally corresponds to the name of the repository but without \"vim\" prefix/suffix.",
      "type": "string",
      "examples": [
        "surround.vim",
        "nerdtree",
        "maktaba"
      ]
    },
    "version": {
      "description": "Dotted version number of the plugin, generally in semantic versioning scheme.",
      "type": "string",
      "examples": [
        "0.0.1",
        "2.0"
      ],
      "default": "0.0.1"
    },
    "description": {
      "description": "Short description of the plugin and what it does (a sentence or two)",
      "type": "string"
    },
    "homepage": {
      "description": "Primary homepage of the plugin.",
      "type": "string",
      "format": "uri"
    },
    "author": {
      "description": "Name of the person or organization that created the plugin",
      "type": "string",
      "examples": [
        "Priya Exampleton",
        "Example Industries"
      ]
    },
    "maintainer": {
      "description": "Name of the person who maintains the plugin",
      "type": "string",
      "examples": [
        "Priya Exampleton"
      ]
    },
    "repository": {
      "$ref": "#/$defs/selfRepository"
    },
    "dependencies": {
      "description": "Plugins that are strictly required for the plugin to work, where keys are plugin names and values may describe where plugins can be fetched from.",
      "type": "object",
      "additionalProperties": {
        "$ref": "#/$defs/otherRepository"
      }
    }
  },
  "$defs": {
    "url": {
      "type": "string",
      "format": "uri",
      "examples": [
        "git://github.com/tpope/vim-surround"
      ]
    },
    "repoType": {
      "enum": [
        "hg",
        "git",
        "svn",
        "bzr"
      ]
    },
    "selfRepository": {
      "description": "Info for the plugin itself. Describes where the canonical copy of the plugin can be fetched from.",
      "type": "object",
      "properties": {
        "type": {
          "$ref": "#/$defs/repoType"
        },
        "url": {
          "$ref": "#/$defs/url"
        },
        "deprecated": {
          "description": "For a deprecated plugin, a deprecation message to be shown to any user who installs the plugin.",
          "type": "string"
        }
      },
      "dependentRequired": {
        "url": [
          "type"
        ],
        "type": [
          "url"
        ]
      }
    },
    "otherRepository": {
      "description": "Info about a plugin/repository outside this one.",
      "type": "object",
      "anyOf": [
        {
          "$comment": "Empty repository info. Used to declare plugin with the given name is required without specifying any explicit details about how to fetch it (e.g., if name can be looked up in a predefined package index).",
          "additionalProperties": false
        },
        {
          "$comment": "Repository with empty type and url pointing to local path.",
          "properties": {
            "type": {
              "enum": [
                "",
                "archive"
              ]
            },
            "url": {
              "$ref": "#/$defs/url"
            },
            "vim_script_nr": {
              "description": "Script ID number of the target plugin on www.vim.org, if any.",
              "type": "number",
              "examples": [
                31,
                1075
              ]
            },
            "script-type": {
              "enum": [
                "color scheme",
                "ftplugin",
                "game",
                "indent",
                "syntax",
                "utility",
                "patch"
              ]
            }
          }
        },
        {
          "$comment": "Explicit remote repository.",
          "properties": {
            "type": {
              "$ref": "#/$defs/repoType"
            },
            "url": {
              "$ref": "#/$defs/url"
            }
          },
          "required": [
            "type",
            "url"
          ],
          "type": "object"
        }
      ],
      "properties": {
        "homepage": {
          "description": "Primary homepage of the plugin.",
          "type": "string",
          "format": "uri"
        },
        "addon-info": {
          "$comment": "Addon information for the other plugin in case it does not supply its own addon-info file.",
          "$ref": "#"
        }
      }
    }
  }
}
