Skip to content

Commit a1785c9

Browse files
Fix mockgenerator schema (#424)
1 parent 7c77fd1 commit a1785c9

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

dev-proxy-plugins/MockResponses/MockResponse.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public class MockResponse {
1010
public string Url { get; set; } = string.Empty;
1111
[JsonPropertyName("method")]
1212
public string Method { get; set; } = "GET";
13-
[JsonPropertyName("nth")]
13+
[JsonPropertyName("nth"), JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
1414
public int? Nth { get; set; }
1515
[JsonPropertyName("responseCode")]
1616
public int? ResponseCode { get; set; } = 200;

dev-proxy-plugins/MockResponses/MockResponsePlugin.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ public class MockResponseConfiguration {
2323
[JsonIgnore]
2424
public bool BlockUnmockedRequests { get; set; } = false;
2525

26+
[JsonPropertyName("$schema")]
27+
public string Schema { get; set; } = "https://raw.githubusercontent.com/microsoft/dev-proxy/main/schemas/v1.0/responses.schema.json";
2628
[JsonPropertyName("responses")]
2729
public IEnumerable<MockResponse> Responses { get; set; } = Array.Empty<MockResponse>();
2830
}

0 commit comments

Comments
 (0)