Repository navigation
Expand file tree
/
Copy pathplugin-index.schema.json
More file actions
67 lines (67 loc) · 3.91 KB
/
Copy pathplugin-index.schema.json
File metadata and controls
67 lines (67 loc) · 3.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://raw.githubusercontent.com/Lithe-IDEA/Lithe-core-rust/main/shared/plugins/contract/v1/plugin-index.schema.json",
"title": "Lithe plugin marketplace index (plugin contract v1)",
"description": "Shape of a marketplace source index file, lithe-plugin-index.json. Semantic rules that JSON Schema cannot express (download URLs inside the entry's own repository, duplicate IDs and versions, the official namespace, platform and API filtering) are defined in README.md and enforced by plugins.marketplace.validateIndex.",
"type": "object",
"additionalProperties": false,
"required": ["schemaVersion", "plugins"],
"properties": {
"schemaVersion": { "const": 0 },
"plugins": { "type": "array", "items": { "$ref": "#/$defs/plugin" } }
},
"$defs": {
"https": { "type": "string", "pattern": "^https://" },
"plugin": {
"type": "object",
"additionalProperties": false,
"required": ["id", "name", "author", "repository", "description", "license", "versions"],
"properties": {
"id": { "type": "string", "pattern": "^[a-z0-9.-]+$" },
"name": { "type": "string", "minLength": 1 },
"author": { "type": "string", "minLength": 1 },
"repository": { "type": "string", "pattern": "^https://github\\.com/[A-Za-z0-9._-]+/[A-Za-z0-9._-]+/?$" },
"homepage": { "$ref": "#/$defs/https" },
"description": { "type": "string", "minLength": 1 },
"localizedDescriptions": {
"description": "Translations of description keyed by language tag (for example zh-Hans). Hosts show the one matching the interface language and fall back to description.",
"type": "object",
"propertyNames": { "pattern": "^[a-z]{2,3}(-[A-Za-z0-9]{2,8})*$" },
"additionalProperties": { "type": "string", "minLength": 1 }
},
"tags": { "type": "array", "items": { "type": "string", "pattern": "^\\S+$" } },
"license": { "type": "string", "minLength": 1 },
"icon": { "type": "string", "pattern": "^https://raw\\.githubusercontent\\.com/" },
"versions": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/version" } }
}
},
"version": {
"type": "object",
"additionalProperties": false,
"required": ["version", "pluginAPIVersion", "requires", "releaseDate", "downloads"],
"properties": {
"version": { "type": "string", "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+$" },
"pluginAPIVersion": { "description": "The package manifest's pluginAPIVersion. Hosts run version 0; any other value is reported as unavailable, not as an invalid index.", "type": "integer", "minimum": 0 },
"requires": {
"description": "The package manifest's requires, including buildProviders when any buildSystems[].provider is present (own or shared language server), so hosts can tell before downloading whether they run every capability it needs. Capability IDs this contract does not define are allowed; such a version is never available.",
"type": "object",
"minProperties": 1,
"propertyNames": { "pattern": "^[a-z][A-Za-z0-9]{0,63}$" },
"additionalProperties": { "type": "integer", "minimum": 0 }
},
"releaseDate": { "type": "string", "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$" },
"downloads": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/download" } }
}
},
"download": {
"type": "object",
"additionalProperties": false,
"required": ["platforms", "downloadURL", "sha256"],
"properties": {
"platforms": { "type": "array", "minItems": 1, "items": { "type": "string", "pattern": "^[a-z0-9]+-[a-z0-9]+$" } },
"downloadURL": { "type": "string", "pattern": "^https://github\\.com/[^/]+/[^/]+/releases/download/[^/]+/[^/]+\\.zip$" },
"sha256": { "type": "string", "pattern": "^[0-9a-f]{64}$" }
}
}
}
}