Skip to content

Commit 1b0b2df

Browse files
Changes default mock request method to POST (#619)
Removes obsolete JsonPropertyName annotations
1 parent 599df14 commit 1b0b2df

File tree

8 files changed

+1
-34
lines changed

8 files changed

+1
-34
lines changed

dev-proxy-abstractions/MockRequest.cs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,19 @@
11
// Copyright (c) Microsoft Corporation.
22
// Licensed under the MIT License.
33

4-
using System.Text.Json.Serialization;
5-
64
namespace Microsoft.DevProxy.Abstractions;
75

86
public class MockRequest
97
{
10-
[JsonPropertyName("url")]
118
public string Url { get; set; } = string.Empty;
12-
[JsonPropertyName("method")]
13-
public string Method { get; set; } = "GET";
14-
[JsonPropertyName("body")]
9+
public string Method { get; set; } = "POST";
1510
public dynamic? Body { get; set; }
16-
[JsonPropertyName("headers")]
1711
public List<MockRequestHeader>? Headers { get; set; }
1812
}
1913

2014
public class MockRequestHeader
2115
{
22-
[JsonPropertyName("name")]
2316
public string Name { get; set; } = string.Empty;
24-
[JsonPropertyName("value")]
2517
public string Value { get; set; } = string.Empty;
2618

2719
public MockRequestHeader()

dev-proxy-plugins/GraphErrorObjects.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ namespace Microsoft.DevProxy.Plugins;
77

88
public class GraphErrorResponseBody
99
{
10-
[JsonPropertyName("error")]
1110
public GraphErrorResponseError Error { get; set; }
1211

1312
public GraphErrorResponseBody(GraphErrorResponseError error)
@@ -18,18 +17,14 @@ public GraphErrorResponseBody(GraphErrorResponseError error)
1817

1918
public class GraphErrorResponseError
2019
{
21-
[JsonPropertyName("code")]
2220
public string Code { get; set; } = string.Empty;
23-
[JsonPropertyName("message")]
2421
public string Message { get; set; } = string.Empty;
25-
[JsonPropertyName("innerError")]
2622
public GraphErrorResponseInnerError? InnerError { get; set; }
2723
}
2824

2925
public class GraphErrorResponseInnerError
3026
{
3127
[JsonPropertyName("request-id")]
3228
public string RequestId { get; set; } = string.Empty;
33-
[JsonPropertyName("date")]
3429
public string Date { get; set; } = string.Empty;
3530
}

dev-proxy-plugins/MinimalPermissions/RequestInfo.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,5 @@ internal class RequestInfo
77
{
88
[JsonPropertyName("requestUrl")]
99
public string Url { get; set; } = string.Empty;
10-
[JsonPropertyName("method")]
1110
public string Method { get; set; } = string.Empty;
1211
}

dev-proxy-plugins/Mocks/GraphConnectorNotificationPlugin.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
using System.Net;
66
using System.Text;
77
using System.Text.Json;
8-
using System.Text.Json.Serialization;
98
using Microsoft.DevProxy.Abstractions;
109
using Microsoft.Extensions.Configuration;
1110
using Microsoft.Extensions.Logging;
@@ -16,9 +15,7 @@ namespace Microsoft.DevProxy.Plugins.Mocks;
1615

1716
public class GraphConnectorNotificationConfiguration : MockRequestConfiguration
1817
{
19-
[JsonPropertyName("audience")]
2018
public string? Audience { get; set; }
21-
[JsonPropertyName("tenant")]
2219
public string? Tenant { get; set; }
2320
}
2421

dev-proxy-plugins/RequestLogs/ExecutionSummaryPlugin.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@ namespace Microsoft.DevProxy.Plugins.RequestLogs;
1212

1313
internal enum SummaryGroupBy
1414
{
15-
[JsonPropertyName("url")]
1615
Url,
17-
[JsonPropertyName("messageType")]
1816
MessageType
1917
}
2018

dev-proxy-plugins/RequestLogs/MinimalPermissionsGuidancePlugin.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,15 @@ internal class MinimalPermissionsGuidancePluginConfiguration
2121

2222
internal class OperationInfo
2323
{
24-
[JsonPropertyName("method")]
2524
public string Method { get; set; } = string.Empty;
26-
[JsonPropertyName("endpoint")]
2725
public string Endpoint { get; set; } = string.Empty;
2826
}
2927

3028
internal class MinimalPermissionsInfo
3129
{
32-
[JsonPropertyName("minimalPermissions")]
3330
public string[] MinimalPermissions { get; set; } = Array.Empty<string>();
34-
[JsonPropertyName("permissionsFromTheToken")]
3531
public string[] PermissionsFromTheToken { get; set; } = Array.Empty<string>();
36-
[JsonPropertyName("excessPermissions")]
3732
public string[] ExcessPermissions { get; set; } = Array.Empty<string>();
38-
[JsonPropertyName("operations")]
3933
public OperationInfo[] Operations { get; set; } = Array.Empty<OperationInfo>();
4034
}
4135

dev-proxy-plugins/RequestLogs/MinimalPermissionsPlugin.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ namespace Microsoft.DevProxy.Plugins.RequestLogs;
1313

1414
internal class MinimalPermissionsPluginConfiguration
1515
{
16-
[JsonPropertyName("type")]
1716
public PermissionsType Type { get; set; } = PermissionsType.Delegated;
1817
}
1918

dev-proxy/ProxyConfiguration.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,27 +20,20 @@ public enum ReleaseType
2020

2121
public class ProxyConfiguration : IProxyConfiguration
2222
{
23-
[JsonPropertyName("port")]
2423
public int Port { get; set; } = 8000;
25-
[JsonPropertyName("ipAddress")]
2624
public string? IPAddress { get; set; } = "127.0.0.1";
27-
[JsonPropertyName("labelMode")]
2825
[JsonConverter(typeof(JsonStringEnumConverter))]
2926
public LabelMode LabelMode { get; set; } = LabelMode.Text;
30-
[JsonPropertyName("record")]
3127
public bool Record { get; set; } = false;
32-
[JsonPropertyName("logLevel")]
3328
[JsonConverter(typeof(JsonStringEnumConverter))]
3429
public LogLevel LogLevel { get; set; } = LogLevel.Information;
3530
public IEnumerable<int> WatchPids { get; set; } = new List<int>();
3631
public IEnumerable<string> WatchProcessNames { get; set; } = new List<string>();
37-
[JsonPropertyName("rate")]
3832
public int Rate { get; set; } = 50;
3933
public bool NoFirstRun { get; set; } = false;
4034
public bool AsSystemProxy { get; set; } = true;
4135
public bool InstallCert { get; set; } = true;
4236
public string ConfigFile { get; set; } = "devproxyrc.json";
43-
[JsonPropertyName("newVersionNotification")]
4437
[JsonConverter(typeof(JsonStringEnumConverter))]
4538
public ReleaseType NewVersionNotification { get; set; } = ReleaseType.Stable;
4639
}

0 commit comments

Comments
 (0)