Skip to content

Commit d4bffd0

Browse files
Adds JSON schema (#414)
1 parent b26abb2 commit d4bffd0

File tree

5 files changed

+123
-0
lines changed

5 files changed

+123
-0
lines changed

dev-proxy/devproxyrc.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"$schema": "https://raw.githubusercontent.com/microsoft/dev-proxy/main/schemas/v1.0/rc.schema.json",
23
"plugins": [
34
{
45
"name": "DevToolsPlugin",

dev-proxy/responses.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
{
2+
"$schema": "https://raw.githubusercontent.com/microsoft/dev-proxy/main/schemas/v1.0/responses.schema.json",
23
"responses": []
34
}

dev-proxy/responses.sample.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"$schema": "https://raw.githubusercontent.com/microsoft/dev-proxy/main/schemas/v1.0/responses.schema.json",
23
"responses": [
34
{
45
"url": "https://graph.microsoft.com/v1.0/me?*",

schemas/v1.0/rc.schema.json

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"title": "Dev Proxy config",
4+
"description": "Configuration for Dev Proxy",
5+
"type": "object",
6+
"properties": {
7+
"ipAddress": {
8+
"type": "string",
9+
"format": "ipv4"
10+
},
11+
"labelMode": {
12+
"type": "string",
13+
"enum": ["debug", "text", "icon", "nerdFont"]
14+
},
15+
"logLevel": {
16+
"type": "string",
17+
"enum": ["debug", "info", "warn", "error"]
18+
},
19+
"plugins": {
20+
"type": "array",
21+
"items": {
22+
"type": "object",
23+
"properties": {
24+
"name": {
25+
"type": "string"
26+
},
27+
"enabled": {
28+
"type": "boolean"
29+
},
30+
"pluginPath": {
31+
"type": "string"
32+
},
33+
"configSection": {
34+
"type": "string"
35+
},
36+
"urlsToWatch": {
37+
"type": "array",
38+
"items": {
39+
"type": "string"
40+
}
41+
}
42+
},
43+
"required": ["name", "enabled", "pluginPath"]
44+
}
45+
},
46+
"port": {
47+
"type": "number",
48+
"minimum": 0,
49+
"maximum": 65535
50+
},
51+
"rate": {
52+
"type": "number",
53+
"minimum": 0,
54+
"maximum": 100
55+
},
56+
"record": {
57+
"type": "boolean"
58+
},
59+
"urlsToWatch": {
60+
"type": "array",
61+
"items": {
62+
"type": "string"
63+
}
64+
},
65+
"watchPids": {
66+
"type": "array",
67+
"items": {
68+
"type": "number"
69+
}
70+
},
71+
"watchProcessNames": {
72+
"type": "array",
73+
"items": {
74+
"type": "string"
75+
}
76+
}
77+
},
78+
"additionalProperties": true,
79+
"required": ["plugins"]
80+
}

schemas/v1.0/responses.schema.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"title": "Dev Proxy responses",
4+
"description": "Responses for Dev Proxy",
5+
"type": "object",
6+
"properties": {
7+
"responses": {
8+
"type": "array",
9+
"items": {
10+
"type": "object",
11+
"properties": {
12+
"url": {
13+
"type": "string"
14+
},
15+
"method": {
16+
"type": "string",
17+
"enum": ["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS", "CONNECT", "TRACE"]
18+
},
19+
"nth": {
20+
"type": "integer"
21+
},
22+
"responseBody": {
23+
"type": ["object", "string"]
24+
},
25+
"responseCode": {
26+
"type": "integer"
27+
},
28+
"responseHeaders": {
29+
"type": "object",
30+
"additionalProperties": {
31+
"type": "string"
32+
}
33+
}
34+
},
35+
"required": ["url"]
36+
}
37+
}
38+
},
39+
"required": ["responses"]
40+
}

0 commit comments

Comments
 (0)