|
1 | 1 | // Copyright (c) Microsoft Corporation. |
2 | 2 | // Licensed under the MIT License. |
3 | 3 |
|
4 | | -using System.Text.Json.Serialization; |
5 | | - |
6 | 4 | namespace Microsoft.DevProxy.Abstractions; |
7 | 5 |
|
8 | 6 | public class MockResponse |
9 | 7 | { |
10 | | - [JsonPropertyName("request")] |
11 | 8 | public MockResponseRequest? Request { get; set; } |
12 | | - [JsonPropertyName("response")] |
13 | 9 | public MockResponseResponse? Response { get; set; } |
14 | 10 | } |
15 | 11 |
|
16 | 12 | public class MockResponseRequest |
17 | 13 | { |
18 | | - [JsonPropertyName("url")] |
19 | 14 | public string Url { get; set; } = string.Empty; |
20 | | - [JsonPropertyName("method")] |
21 | 15 | public string Method { get; set; } = "GET"; |
22 | | - [JsonPropertyName("nth"), JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] |
23 | 16 | public int? Nth { get; set; } |
24 | 17 | } |
25 | 18 |
|
26 | 19 | public class MockResponseResponse |
27 | 20 | { |
28 | | - [JsonPropertyName("statusCode")] |
29 | 21 | public int? StatusCode { get; set; } = 200; |
30 | | - [JsonPropertyName("body")] |
31 | 22 | public dynamic? Body { get; set; } |
32 | | - [JsonPropertyName("headers")] |
33 | 23 | public List<MockResponseHeader>? Headers { get; set; } |
34 | 24 | } |
35 | 25 |
|
36 | 26 | public class MockResponseHeader |
37 | 27 | { |
38 | | - [JsonPropertyName("name")] |
39 | 28 | public string Name { get; set; } = string.Empty; |
40 | | - [JsonPropertyName("value")] |
41 | 29 | public string Value { get; set; } = string.Empty; |
42 | 30 |
|
43 | 31 | public MockResponseHeader() |
|
0 commit comments