Skip to content

Commit 361215a

Browse files
authored
seperate out devContainer schemas for vscode & codespaces (microsoft#156170)
* seperateout devContainer schemas for vscode & codespaces * fix for vscode schema
1 parent c4141cf commit 361215a

File tree

2 files changed

+215
-0
lines changed

2 files changed

+215
-0
lines changed
Lines changed: 182 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,182 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"type": "object",
4+
"properties": {
5+
"customizations": {
6+
"type": "object",
7+
"properties": {
8+
"codespaces": {
9+
"type": "object",
10+
"description": "Customizations specific to GitHub Codespaces",
11+
"properties": {
12+
"repositories": {
13+
"type": "object",
14+
"description": "Configuration relative to the given repositories, following the format 'owner/repo'.\n A wildcard (*) is permitted for the repo name (eg: 'microsoft/*')",
15+
"patternProperties": {
16+
"^[a-zA-Z0-9-_.]+[.]*\/[a-zA-Z0-9-_*]+[.]*$": {
17+
"type": "object",
18+
"additionalProperties": true,
19+
"oneOf": [
20+
{
21+
"properties": {
22+
"permissions": {
23+
"type": "object",
24+
"description": "Additional repository permissions.\n See https://aka.ms/ghcs/multi-repo-auth for more info.",
25+
"additionalProperties": true,
26+
"anyOf": [
27+
{
28+
"properties": {
29+
"actions": {
30+
"type": "string",
31+
"enum": [
32+
"read",
33+
"write"
34+
]
35+
}
36+
}
37+
},
38+
{
39+
"properties": {
40+
"checks": {
41+
"type": "string",
42+
"enum": [
43+
"read",
44+
"write"
45+
]
46+
}
47+
}
48+
},
49+
{
50+
"properties": {
51+
"contents": {
52+
"type": "string",
53+
"enum": [
54+
"read",
55+
"write"
56+
]
57+
}
58+
}
59+
},
60+
{
61+
"properties": {
62+
"deployments": {
63+
"type": "string",
64+
"enum": [
65+
"read",
66+
"write"
67+
]
68+
}
69+
}
70+
},
71+
{
72+
"properties": {
73+
"discussions": {
74+
"type": "string",
75+
"enum": [
76+
"read",
77+
"write"
78+
]
79+
}
80+
}
81+
},
82+
{
83+
"properties": {
84+
"issues": {
85+
"type": "string",
86+
"enum": [
87+
"read",
88+
"write"
89+
]
90+
}
91+
}
92+
},
93+
{
94+
"properties": {
95+
"packages": {
96+
"type": "string",
97+
"enum": [
98+
"read"
99+
]
100+
}
101+
}
102+
},
103+
{
104+
"properties": {
105+
"pages": {
106+
"type": "string",
107+
"enum": [
108+
"read",
109+
"write"
110+
]
111+
}
112+
}
113+
},
114+
{
115+
"properties": {
116+
"pull_requests": {
117+
"type": "string",
118+
"enum": [
119+
"read",
120+
"write"
121+
]
122+
}
123+
}
124+
},
125+
{
126+
"properties": {
127+
"repository_projects": {
128+
"type": "string",
129+
"enum": [
130+
"read",
131+
"write"
132+
]
133+
}
134+
}
135+
},
136+
{
137+
"properties": {
138+
"statuses": {
139+
"type": "string",
140+
"enum": [
141+
"read",
142+
"write"
143+
]
144+
}
145+
}
146+
},
147+
{
148+
"properties": {
149+
"workflows": {
150+
"type": "string",
151+
"enum": [
152+
"write"
153+
]
154+
}
155+
}
156+
}
157+
]
158+
}
159+
}
160+
},
161+
{
162+
"properties": {
163+
"permissions": {
164+
"type": "string",
165+
"description": "Additional repository permissions.\n See https://aka.ms/ghcs/multi-repo-auth for more info.",
166+
"enum": [
167+
"read-all",
168+
"write-all"
169+
]
170+
}
171+
}
172+
}
173+
]
174+
}
175+
}
176+
}
177+
}
178+
}
179+
}
180+
}
181+
}
182+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"type": "object",
4+
"properties": {
5+
"customizations": {
6+
"type": "object",
7+
"properties": {
8+
"vscode": {
9+
"type": "object",
10+
"properties": {
11+
"extensions": {
12+
"type": "array",
13+
"description": "An array of extensions that should be installed into the container.",
14+
"items": {
15+
"type": "string",
16+
"pattern": "^([a-z0-9A-Z][a-z0-9A-Z-]*)\\.([a-z0-9A-Z][a-z0-9A-Z-]*)(@(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?)?$",
17+
"errorMessage": "Expected format: '${publisher}.${name}' or '${publisher}.${name}@${version}'. Example: 'ms-dotnettools.csharp'."
18+
}
19+
},
20+
"settings": {
21+
"$ref": "vscode://schemas/settings/machine",
22+
"description": "Machine specific settings that should be copied into the container. These are only copied when connecting to the container for the first time, rebuilding the container then triggers it again."
23+
},
24+
"devPort": {
25+
"type": "integer",
26+
"description": "The port VS Code can use to connect to its backend."
27+
}
28+
}
29+
}
30+
}
31+
}
32+
}
33+
}

0 commit comments

Comments
 (0)