{
  "$id": "https://deno.land/x/deno/cli/schemas/registry-completions.v1.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$defs": {
    "registry": {
      "type": "object",
      "required": [
        "schema",
        "variables"
      ],
      "properties": {
        "schema": {
          "type": "string",
          "description": "The Express-like path matching string, where a specifier in the editor will be matched against, and the variables interpolated to provide a completion suggestion.",
          "examples": [
            "/:package([a-z0-9_]*)/:path*",
            "/:package([a-z0-9_]*)@:version?/:path*"
          ]
        },
        "variables": {
          "default": [],
          "description": "The variables that are contained in the schema string.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/variable"
          }
        }
      }
    },
    "variable": {
      "type": "object",
      "required": [
        "key",
        "url"
      ],
      "properties": {
        "key": {
          "type": "string",
          "description": "The variable key name in the schema, which will be used to build the completion suggestions.",
          "examples": [
            "package",
            "version",
            "path"
          ]
        },
        "url": {
          "type": "string",
          "description": "The \"endpoint\" to call to provide values to complete the specifier. This endpoint should return an array of strings. Parsed values can be substituted using ${key} syntax.",
          "examples": [
            "https://example.com/api/packages",
            "https://example.com/api/packages/{package}",
            "https://example.com/api/packages/{package}/${{version}}"
          ]
        }
      }
    }
  },
  "title": "Deno Registry Completion Schema",
  "description": "A definition of meta data that allows a Deno language server form auto completion suggestions for modules within a module registry.",
  "type": "object",
  "required": [
    "version",
    "registries"
  ],
  "properties": {
    "version": {
      "description": "The version of the schema document.",
      "type": "integer",
      "minimum": 1,
      "maximum": 1,
      "examples": [
        1
      ]
    },
    "registries": {
      "default": [],
      "description": "The registries that exist for this origin.",
      "type": "array",
      "items": {
        "$ref": "#/$defs/registry"
      }
    }
  }
}
