Skip to content

Commit d6c9114

Browse files
committed
Update Dev Proxy configuration files and schemas
Closes #2
1 parent fa7ca2a commit d6c9114

File tree

2 files changed

+78
-40
lines changed

2 files changed

+78
-40
lines changed

README.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,24 @@ The Dev Proxy extension makes it easy to create and update configuration files.
1010

1111
| Prefix | Description |
1212
| ------ | ----------- |
13-
| `devproxy-config` | Dev Proxy config file |
14-
| `devproxy-config-schema` | Dev Proxy config schema |
15-
| `devproxy-errors` | Dev Proxy errors file |
13+
| `devproxy-config-file` | Dev Proxy config file |
14+
| `devproxy-config-file-schema` | Dev Proxy config file schema |
15+
| `devproxy-mocks-file` | Dev Proxy mocks file |
16+
| `devproxy-mocks-file-schema` | Dev Proxy mocks file schema |
1617
| `devproxy-plugin-caching-guidance` | CachingGuidancePlugin instance |
1718
| `devproxy-plugin-caching-guidance-config` | CachingGuidancePlugin config section |
1819
| `devproxy-plugin-crud-api` | CrudApiPlugin instance |
1920
| `devproxy-plugin-crud-api-config` | CrudApiPlugin config section |
20-
| `devproxy-plugin-crud-api-schema` | CrudApiPlugin schema |
21+
| `devproxy-plugin-crud-api-file` | CrudApiPlugin API file |
22+
| `devproxy-plugin-crud-api-file-schema` | CrudApiPlugin API file schema |
2123
| `devproxy-plugin-dev-tools` | DevToolsPlugin instance |
2224
| `devproxy-plugin-dev-tools-config` | DevToolsPlugin config section |
2325
| `devproxy-plugin-execution-summary` | ExecutionSummaryPlugin instance |
2426
| `devproxy-plugin-execution-summary-config` | ExecutionSummaryPlugin config section |
2527
| `devproxy-plugin-generic-random-error` | GenericRandomErrorPlugin instance |
2628
| `devproxy-plugin-generic-random-error-config` | GenericRandomErrorPlugin config section |
27-
| `devproxy-plugin-generic-random-error-schema` | GenericRandomErrorPlugin schema |
29+
| `devproxy-plugin-generic-random-error-file` | GenericRandomErrorPlugin errors file |
30+
| `devproxy-plugin-generic-random-error-file-schema` | GenericRandomErrorPlugin errors file schema |
2831
| `devproxy-plugin-graph-beta-support-guidance` | GraphBetaSupportGuidancePlugin instance |
2932
| `devproxy-plugin-graph-client-request-id-guidance` | GraphClientRequestIdGuidancePlugin instance |
3033
| `devproxy-plugin-graph-mock-response` | GraphMockResponsePlugin instance |
@@ -47,10 +50,11 @@ The Dev Proxy extension makes it easy to create and update configuration files.
4750
| `devproxy-plugin-open-api-spec-generator` | OpenApiSpecGeneratorPlugin instance |
4851
| `devproxy-plugin-rate-limiting` | MockResponsePlugin instance |
4952
| `devproxy-plugin-rate-limiting-config` | RateLimitingPlugin config section |
50-
| `devproxy-plugin-rate-limiting-schema` | RateLimitingPlugin schema |
53+
| `devproxy-plugin-rate-limiting-file` | Dev Proxy rate limiting file |
54+
| `devproxy-plugin-rate-limiting-file-schema` | Dev Proxy rate limiting file schema |
5155
| `devproxy-plugin-retry-after` | RetryAfterPlugin instance |
52-
| `devproxy-response` | Empty Dev Proxy response |
53-
| `devproxy-response-header` | Empty Dev Proxy response header |
56+
| `devproxy-response` | Dev Proxy response |
57+
| `devproxy-response-header` | Dev Proxy response header |
5458

5559
### Diagnostics
5660

src/snippets.json

Lines changed: 66 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"Config": {
3-
"prefix": "devproxy-config",
2+
"ConfigFile": {
3+
"prefix": "devproxy-config-file",
44
"body": [
55
"{",
66
"\t\"\\$schema\": \"https://raw.githubusercontent.com/microsoft/dev-proxy/main/schemas/v1.0/rc.schema.json\",",
@@ -10,24 +10,29 @@
1010
],
1111
"description": "Dev Proxy config file"
1212
},
13-
"ConfigSchema": {
14-
"prefix": "devproxy-config-schema",
13+
"ConfigFileSchema": {
14+
"prefix": "devproxy-config-file-schema",
1515
"body": [
1616
"\"\\$schema\": \"https://raw.githubusercontent.com/microsoft/dev-proxy/main/schemas/v1.0/rc.schema.json\","
1717
],
18-
"description": "Dev Proxy config schema"
18+
"description": "Dev Proxy config file schema"
1919
},
20-
"Errors": {
21-
"prefix": "devproxy-errors",
20+
"MocksFile": {
21+
"prefix": "devproxy-mocks-file",
2222
"body": [
2323
"{",
24-
"\t\"\\$schema\": \"https://raw.githubusercontent.com/microsoft/dev-proxy/main/schemas/v1.0/genericrandomerrorplugin.schema.json\",",
25-
"\t\"responses\": [",
26-
"\t\t$1",
27-
"\t]",
24+
"\t\"\\$schema\": \"https://raw.githubusercontent.com/microsoft/dev-proxy/main/schemas/v1.0/mockresponseplugin.schema.json\",",
25+
"\t\"mocks\": [$1]",
2826
"}"
2927
],
30-
"description": "Dev Proxy errors file"
28+
"description": "Dev Proxy mocks file"
29+
},
30+
"MocksFileSchema": {
31+
"prefix": "devproxy-mocks-file-schema",
32+
"body": [
33+
"\"\\$schema\": \"https://raw.githubusercontent.com/microsoft/dev-proxy/main/schemas/v1.0/mockresponseplugin.schema.json\","
34+
],
35+
"description": "Dev Proxy mocks file schema"
3136
},
3237
"CachingGuidancePlugin": {
3338
"prefix": "devproxy-plugin-caching-guidance",
@@ -71,12 +76,24 @@
7176
],
7277
"description": "CrudApiPlugin config section"
7378
},
74-
"CrudApiPluginSchema": {
75-
"prefix": "devproxy-plugin-crud-api-schema",
79+
"CrudApiPluginApiFile": {
80+
"prefix": "devproxy-plugin-crud-api-file",
81+
"body": [
82+
"{",
83+
"\t\"\\$schema\": \"https://raw.githubusercontent.com/microsoft/dev-proxy/main/schemas/v1.0/crudapiplugin.schema.json\",",
84+
"\t\"actions\": [$1],",
85+
"\t\"baseUrl\": \"$2\",",
86+
"\t\"dataFile\": \"$3\"",
87+
"}"
88+
],
89+
"description": "CrudApiPlugin API file"
90+
},
91+
"CrudApiPluginFileSchema": {
92+
"prefix": "devproxy-plugin-crud-api-file-schema",
7693
"body": [
7794
"\"\\$schema\": \"https://raw.githubusercontent.com/microsoft/dev-proxy/main/schemas/v1.0/crudapiplugin.schema.json\","
7895
],
79-
"description": "CrudApiPlugin schema"
96+
"description": "CrudApiPlugin API file schema"
8097
},
8198
"DevToolsPlugin": {
8299
"prefix": "devproxy-plugin-dev-tools",
@@ -141,13 +158,22 @@
141158
],
142159
"description": "GenericRandomErrorPlugin config section"
143160
},
144-
"GenericRandomErrorPluginSchema": {
145-
"prefix": "devproxy-plugin-generic-random-error-schema",
161+
"GenericRandomErrorPluginFile": {
162+
"prefix": "devproxy-plugin-generic-random-error-file",
163+
"body": [
164+
"{",
165+
"\t\"\\$schema\": \"https://raw.githubusercontent.com/microsoft/dev-proxy/main/schemas/v1.0/genericrandomerrorplugin.schema.json\",",
166+
"\t\"responses\": [$1]",
167+
"}"
168+
],
169+
"description": "GenericRandomErrorPlugin errors file"
170+
},
171+
"GenericRandomErrorPluginFileSchema": {
172+
"prefix": "devproxy-plugin-generic-random-error-file-schema",
146173
"body": [
147174
"\"\\$schema\": \"https://raw.githubusercontent.com/microsoft/dev-proxy/main/schemas/v1.0/genericrandomerrorplugin.schema.json\","
148-
149175
],
150-
"description": "GenericRandomErrorPlugin schema"
176+
"description": "GenericRandomErrorPlugin errors file schema"
151177
},
152178
"GraphBetaSupportGuidancePlugin": {
153179
"prefix": "devproxy-plugin-graph-beta-support-guidance",
@@ -378,7 +404,7 @@
378404
],
379405
"description": "MockResponsePlugin config section"
380406
},
381-
"MockResponsePluginSchema": {
407+
"MockResponsePluginFileSchema": {
382408
"prefix": "devproxy-plugin-mock-response-schema",
383409
"body": [
384410
"\"\\$schema\": \"https://raw.githubusercontent.com/microsoft/dev-proxy/main/schemas/v1.0/mockresponseplugin.schema.json\","
@@ -451,12 +477,24 @@
451477
],
452478
"description": "RateLimitingPlugin config section"
453479
},
454-
"RateLimitingPluginSchema": {
455-
"prefix": "devproxy-plugin-rate-limiting-schema",
480+
"RateLimitingFile": {
481+
"prefix": "devproxy-plugin-rate-limiting-file",
456482
"body": [
457-
"\"\\$schema\": \"https://raw.githubusercontent.com/microsoft/dev-proxy/main/schemas/v1.0/ratelimitingplugin.schema.json\","
483+
"{",
484+
"\t\"\\$schema\": \"https://raw.githubusercontent.com/microsoft/dev-proxy/main/schemas/v1.0/ratelimitingplugin.schema.json\",",
485+
"\t\"body\": {$1},",
486+
"\t\"headers\": [$2],",
487+
"\t\"statusCode\": 429$3",
488+
"}"
458489
],
459-
"description": "RateLimitingPlugin schema"
490+
"description": "Dev Proxy rate limiting file"
491+
},
492+
"RateLimitingFileSchema": {
493+
"prefix": "devproxy-plugin-rate-limiting-file-schema",
494+
"body": [
495+
"\"\\$schema\": \"https://raw.githubusercontent.com/microsoft/dev-proxy/main/schemas/v1.0/crudapiplugin.schema.json\","
496+
],
497+
"description": "Dev Proxy rate limiting file schema"
460498
},
461499
"RetryAfterPlugin": {
462500
"prefix": "devproxy-plugin-retry-after",
@@ -474,15 +512,11 @@
474512
"body": [
475513
"{",
476514
"\t\"statusCode\": ${1:400},",
477-
"\t\"body\": {",
478-
"\t\t$2",
479-
"\t},",
480-
"\t\"headers\": [",
481-
"\t\t$3",
482-
"\t]",
515+
"\t\"body\": { $2 },",
516+
"\t\"headers\": [ $3 ]",
483517
"}"
484518
],
485-
"description": "Empty Dev Proxy response"
519+
"description": "Dev Proxy response"
486520
},
487521
"ResponseHeader": {
488522
"prefix": "devproxy-response-header",
@@ -492,6 +526,6 @@
492526
"\t\"value\": \"$2\"",
493527
"}"
494528
],
495-
"description": "Empty Dev Proxy response header"
529+
"description": "Dev Proxy response header"
496530
}
497531
}

0 commit comments

Comments
 (0)