1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-27 01:29:14 -05:00
denoland-deno/cli/schemas/registry-completions.v1.json

85 lines
2.4 KiB
JSON
Raw Normal View History

{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://deno.land/x/deno/cli/schemas/registry-completions.v1.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": 1,
"examples": [
1
]
},
"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"
]
},
"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}}"
]
}
}
}
}
}