Repository navigation
Expand file tree
/
Copy pathplugin-index.schema.json
More file actions
75 lines (75 loc) · 4.01 KB
/
Copy pathplugin-index.schema.json
File metadata and controls
75 lines (75 loc) · 4.01 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
68
69
70
71
72
73
74
75
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://raw.githubusercontent.com/Lithe-IDEA/lithe-plugin-docs/main/contract/v1/plugin-index.schema.json",
"title": "Lithe plugin marketplace index (plugin contract v1)",
"description": "Shape of a marketplace source index. 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": 1 },
"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", "releaseDate", "downloads"],
"if": { "properties": { "pluginAPIVersion": { "const": 3 } } },
"then": { "required": ["requires"] },
"properties": {
"version": { "type": "string", "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+$" },
"pluginAPIVersion": { "type": "integer", "minimum": 1 },
"requires": {
"description": "API level 3: the package manifest's requires, including buildProviders: 1 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": 1 }
},
"releaseDate": { "type": "string", "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$" },
"downloads": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/download" } }
},
"allOf": [
{
"if": { "properties": { "pluginAPIVersion": { "maximum": 2 } } },
"then": { "not": { "required": ["requires"] } }
}
]
},
"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}$" }
}
}
}
}