-
Notifications
You must be signed in to change notification settings - Fork 68
/
braids-json.schema.json
91 lines (91 loc) · 2.91 KB
/
braids-json.schema.json
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
{
"title": "schema for .braids.json configuration file",
"type": "object",
"properties": {
"config_version": {
"type": "number",
"enum": [
1
],
"description": "configuration format version (see https://cristibalan.github.io/braid/#braid-version-compatibility)",
"$comment": "So far, only version 1 is defined. (Version \"0\" is a mess and not worth writing a schema for.) When we have more than one defined version, we can look into the best way to make the rest of the schema dependent on the version."
},
"mirrors": {
"type": "object",
"description": "container for all added vendor repository mirrors",
"patternProperties": {
".*": {
"allOf": [
{
"type": "object",
"description": "local path where the vendor content is placed, relative to the .braids.json file",
"properties": {
"url": {
"type": "string",
"description": "remote URL of the vendor repository"
},
"path": {
"type": "string",
"description": "path to a subdirectory or single file in the vendor tree (instead of the whole tree) to place at the specified local path"
},
"branch": {
"type": "string",
"description": "branch name of the vendor repository to track"
},
"tag": {
"type": "string",
"description": "tag name of the vendor repository to track"
},
"revision": {
"type": "string",
"description": "commit ID of the vendor repository currently used by the mirror"
}
},
"required": [
"url",
"revision"
],
"additionalProperties": false
},
{
"$comment": "At most one of \"branch\" and \"tag\". Technique from https://stackoverflow.com/a/33358676 .",
"oneOf": [
{
"not": {
"anyOf": [
{
"required": [
"branch"
]
},
{
"required": [
"tag"
]
}
]
}
},
{
"required": [
"branch"
]
},
{
"required": [
"tag"
]
}
]
}
]
}
}
}
},
"required": [
"config_version",
"mirrors"
],
"additionalProperties": false
}