1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-14 16:33:45 -05:00
denoland-deno/cli/schemas/registry-completions.v2.json
2021-12-14 06:24:11 +11:00

93 lines
3.3 KiB
JSON

{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://deno.land/x/deno/cli/schemas/registry-completions.v2.json",
"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.",
"required": [
"version",
"registries"
],
"type": "object",
"properties": {
"version": {
"description": "The version of the schema document.",
"type": "integer",
"minimum": 1,
"maximum": 2,
"examples": [
2
]
},
"registries": {
"default": [],
"description": "The registries that exist for this origin.",
"type": "array",
"items": {
"$ref": "#/definitions/registry"
}
}
},
"definitions": {
"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": "#/definitions/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"
]
},
"documentation": {
"type": "string",
"description": "An optional \"endpoint\" to call to provide documentation for specified variable, which can be displayed to the client in the response. This can provide description information about the item. The value should contain the variable name in the template. Baseless URLs can be supplied and the host for the configuration file will be used as the base.",
"examples": [
"https://example.com/api/documentation/packages/${package}/${{version}}/${path}",
"/api/documentation/packages/${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. In order to support incremental completions, the value should contain the variable name in the template. Baseless URLs can be supplied and the host for the configuration file will be used as the base.",
"examples": [
"https://example.com/api/packages",
"https://example.com/api/packages/${package}",
"https://example.com/api/packages/${package}/${{version}}",
"/api/packages/${package}/${{version}}/${path}"
]
}
}
}
}
}