Skip to content

Commit cac9fb9

Browse files
Merge branch 'main' into waldekmastykarz-patch-1
2 parents 4aac0bd + a05e85d commit cac9fb9

33 files changed

+1460
-197
lines changed

dev-proxy-plugins/Mocks/GraphConnectorNotificationPlugin.cs

Lines changed: 0 additions & 195 deletions
This file was deleted.

dev-proxy-plugins/TypeSpec/Http.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ override public string ToString()
180180
sb.AppendLine($"@useAuth({Auth.ToString()})");
181181
}
182182
sb.Append($"op {Name}(");
183-
sb.AppendJoin(", ", Parameters.Select(p => p.ToString()));
183+
sb.AppendJoin(", ", Parameters.Select(p => p.ToString(this)));
184184
sb.Append("): ");
185185
sb.AppendJoin(" | ", Responses.Select(r => r.GetModelName()));
186186
sb.Append(';');
@@ -266,11 +266,19 @@ internal class Parameter
266266
public required string Name { get; init; }
267267
public string? Value { get; init; }
268268

269-
override public string ToString()
269+
public override string ToString()
270+
{
271+
throw new NotImplementedException("Use ToString(Operation op) instead.");
272+
}
273+
274+
public string ToString(Operation op)
270275
{
271276
var value = Value?.IndexOfAny([' ', '/', '-', ';']) == -1
272277
? Value
273278
: $"\"{Value}\"";
279+
value = op.Method == HttpVerb.Patch && In == ParameterLocation.Body
280+
? $"MergePatchUpdate<{value}>"
281+
: value;
274282
if (Name.IndexOf('-') > -1)
275283
{
276284
var target = Name;
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"title": "Dev Proxy ApiCenterMinimalPermissionsPlugin config schema",
4+
"type": "object",
5+
"properties": {
6+
"$schema": {
7+
"type": "string",
8+
"description": "The JSON schema reference for validation."
9+
},
10+
"resourceGroupName": {
11+
"type": "string",
12+
"description": "Name of the resource group where the Azure API Center is located."
13+
},
14+
"serviceName": {
15+
"type": "string",
16+
"description": "Name of the Azure API Center instance that Dev Proxy should use to check if the APIs used in the app are registered."
17+
},
18+
"subscriptionId": {
19+
"type": "string",
20+
"description": "ID of the Azure subscription where the Azure API Center instance is located."
21+
},
22+
"workspace": {
23+
"type": "string",
24+
"description": "Name of the Azure API Center workspace to use. Default is 'default'.",
25+
"default": "default"
26+
}
27+
},
28+
"required": [
29+
"resourceGroupName",
30+
"serviceName",
31+
"subscriptionId"
32+
],
33+
"additionalProperties": false
34+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"title": "Dev Proxy ApiCenterOnboardingPlugin config schema",
4+
"type": "object",
5+
"properties": {
6+
"$schema": {
7+
"type": "string",
8+
"description": "The JSON schema reference for validation."
9+
},
10+
"createApicEntryForNewApis": {
11+
"type": "boolean",
12+
"description": "Set to true to have Dev Proxy create new API entries for APIs detected but not yet registered in API Center. When false, Dev Proxy only lists unregistered APIs. Default is true."
13+
},
14+
"resourceGroupName": {
15+
"type": "string",
16+
"description": "Name of the resource group where the Azure API Center is located."
17+
},
18+
"serviceName": {
19+
"type": "string",
20+
"description": "Name of the Azure API Center instance that Dev Proxy should use to check if the APIs used in the app are registered."
21+
},
22+
"subscriptionId": {
23+
"type": "string",
24+
"description": "ID of the Azure subscription where the Azure API Center instance is located."
25+
},
26+
"workspace": {
27+
"type": "string",
28+
"description": "Name of the Azure API Center workspace to use. Default is 'default'."
29+
}
30+
},
31+
"required": [
32+
"resourceGroupName",
33+
"serviceName",
34+
"subscriptionId"
35+
],
36+
"additionalProperties": false
37+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"title": "Dev Proxy ApiCenterProductionVersionPlugin config schema",
4+
"type": "object",
5+
"properties": {
6+
"$schema": {
7+
"type": "string",
8+
"description": "The JSON schema reference for validation."
9+
},
10+
"resourceGroupName": {
11+
"type": "string",
12+
"description": "Name of the resource group where the Azure API Center is located."
13+
},
14+
"serviceName": {
15+
"type": "string",
16+
"description": "Name of the Azure API Center instance that Dev Proxy should use to check if the APIs used in the app are registered."
17+
},
18+
"subscriptionId": {
19+
"type": "string",
20+
"description": "ID of the Azure subscription where the Azure API Center instance is located."
21+
},
22+
"workspace": {
23+
"type": "string",
24+
"description": "Name of the Azure API Center workspace to use. Default is 'default'."
25+
}
26+
},
27+
"required": [
28+
"resourceGroupName",
29+
"serviceName",
30+
"subscriptionId"
31+
],
32+
"additionalProperties": false
33+
}

0 commit comments

Comments
 (0)