Skip to content

Commit 0b598eb

Browse files
Updates schemas
1 parent c76ce40 commit 0b598eb

File tree

6 files changed

+156
-69
lines changed

6 files changed

+156
-69
lines changed

dev-proxy/devproxy-errors.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,12 @@
4242
"message": "Too Many Requests",
4343
"details": "The user has sent too many requests in a given amount of time (\"rate limiting\")."
4444
},
45-
"headers": {
46-
"Retry-After": "@dynamic"
47-
}
45+
"headers": [
46+
{
47+
"name": "Retry-After",
48+
"value": "@dynamic"
49+
}
50+
]
4851
},
4952
{
5053
"statusCode": 500,

schemas/v1.0/crudapiplugin.schema.json

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,26 @@
2626
},
2727
"method": {
2828
"type": "string",
29-
"enum": ["GET", "POST", "PUT", "PATCH", "DELETE"]
29+
"enum": [
30+
"GET",
31+
"POST",
32+
"PUT",
33+
"PATCH",
34+
"DELETE"
35+
]
3036
}
3137
},
32-
"required": ["action"],
38+
"required": [
39+
"action"
40+
],
3341
"additionalProperties": false
3442
}
3543
}
3644
},
37-
"required": ["baseUrl", "dataFile", "actions"],
45+
"required": [
46+
"baseUrl",
47+
"dataFile",
48+
"actions"
49+
],
3850
"additionalProperties": false
3951
}
Lines changed: 44 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,50 @@
11
{
2-
"$schema": "https://json-schema.org/draft/2020-12/schema",
3-
"title": "Dev Proxy GenericRandomErrorPlugin responses",
4-
"description": "Mocks for the Dev Proxy GenericRandomErrorPlugin",
5-
"type": "object",
6-
"properties": {
7-
"responses": {
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"title": "Dev Proxy GenericRandomErrorPlugin responses",
4+
"description": "Mocks for the Dev Proxy GenericRandomErrorPlugin",
5+
"type": "object",
6+
"properties": {
7+
"responses": {
8+
"type": "array",
9+
"items": {
10+
"type": "object",
11+
"properties": {
12+
"body": {
13+
"type": [
14+
"object",
15+
"string"
16+
]
17+
},
18+
"statusCode": {
19+
"type": "integer"
20+
},
21+
"headers": {
822
"type": "array",
923
"items": {
10-
"type": "object",
11-
"properties": {
12-
"body": {
13-
"type": [
14-
"object",
15-
"string"
16-
]
17-
},
18-
"statusCode": {
19-
"type": "integer"
20-
},
21-
"headers": {
22-
"type": "object",
23-
"additionalProperties": {
24-
"type": "string"
25-
}
26-
}
24+
"type": "object",
25+
"properties": {
26+
"name": {
27+
"type": "string"
2728
},
28-
"required": [
29-
"statusCode",
30-
"body"
31-
]
29+
"value": {
30+
"type": "string"
31+
}
32+
},
33+
"required": [
34+
"name",
35+
"value"
36+
]
3237
}
33-
}
34-
},
35-
"required": [
36-
"responses"
37-
]
38+
}
39+
},
40+
"required": [
41+
"statusCode",
42+
"body"
43+
]
44+
}
45+
}
46+
},
47+
"required": [
48+
"responses"
49+
]
3850
}

schemas/v1.0/mockresponseplugin.schema.json

Lines changed: 40 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,32 +17,64 @@
1717
},
1818
"method": {
1919
"type": "string",
20-
"enum": ["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS", "CONNECT", "TRACE"]
20+
"enum": [
21+
"GET",
22+
"POST",
23+
"PUT",
24+
"PATCH",
25+
"DELETE",
26+
"HEAD",
27+
"OPTIONS",
28+
"CONNECT",
29+
"TRACE"
30+
]
2131
},
2232
"nth": {
2333
"type": "integer"
2434
}
2535
},
26-
"required": ["url"]
36+
"required": [
37+
"url"
38+
]
2739
},
2840
"response": {
2941
"body": {
30-
"type": ["object", "string"]
42+
"type": [
43+
"object",
44+
"string"
45+
]
3146
},
3247
"code": {
3348
"type": "integer"
3449
},
3550
"headers": {
36-
"type": "object",
37-
"additionalProperties": {
38-
"type": "string"
51+
"type": "array",
52+
"items": {
53+
"type": "object",
54+
"properties": {
55+
"name": {
56+
"type": "string"
57+
},
58+
"value": {
59+
"type": "string"
60+
}
61+
},
62+
"required": [
63+
"name",
64+
"value"
65+
]
3966
}
4067
}
4168
}
4269
},
43-
"required": ["request", "response"]
70+
"required": [
71+
"request",
72+
"response"
73+
]
4474
}
4575
}
4676
},
47-
"required": ["mocks"]
77+
"required": [
78+
"mocks"
79+
]
4880
}
Lines changed: 31 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,35 @@
11
{
2-
"$schema": "https://json-schema.org/draft/2020-12/schema",
3-
"title": "Dev Proxy RateLimitingPlugin response",
4-
"description": "Mock for the Dev Proxy RateLimitingPlugin",
5-
"type": "object",
6-
"properties": {
7-
"body": {
8-
"type": [
9-
"object",
10-
"string"
11-
]
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"title": "Dev Proxy RateLimitingPlugin response",
4+
"description": "Mock for the Dev Proxy RateLimitingPlugin",
5+
"type": "object",
6+
"properties": {
7+
"body": {
8+
"type": [
9+
"object",
10+
"string"
11+
]
12+
},
13+
"statusCode": {
14+
"type": "integer"
15+
},
16+
"headers": {
17+
"type": "array",
18+
"items": {
19+
"type": "object",
20+
"properties": {
21+
"name": {
22+
"type": "string"
23+
},
24+
"value": {
25+
"type": "string"
26+
}
1227
},
13-
"statusCode": {
14-
"type": "integer"
15-
},
16-
"headers": {
17-
"type": "object",
18-
"additionalProperties": {
19-
"type": "string"
20-
}
21-
}
28+
"required": [
29+
"name",
30+
"value"
31+
]
32+
}
2233
}
34+
}
2335
}

schemas/v1.0/rc.schema.json

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,21 @@
1010
},
1111
"labelMode": {
1212
"type": "string",
13-
"enum": ["debug", "text", "icon", "nerdFont"]
13+
"enum": [
14+
"debug",
15+
"text",
16+
"icon",
17+
"nerdFont"
18+
]
1419
},
1520
"logLevel": {
1621
"type": "string",
17-
"enum": ["debug", "info", "warn", "error"]
22+
"enum": [
23+
"debug",
24+
"info",
25+
"warn",
26+
"error"
27+
]
1828
},
1929
"plugins": {
2030
"type": "array",
@@ -40,7 +50,11 @@
4050
}
4151
}
4252
},
43-
"required": ["name", "enabled", "pluginPath"]
53+
"required": [
54+
"name",
55+
"enabled",
56+
"pluginPath"
57+
]
4458
}
4559
},
4660
"port": {
@@ -76,5 +90,7 @@
7690
}
7791
},
7892
"additionalProperties": true,
79-
"required": ["plugins"]
93+
"required": [
94+
"plugins"
95+
]
8096
}

0 commit comments

Comments
 (0)