Skip to content

Commit 03fb89a

Browse files
committed
add xml docs for converter
1 parent a82e681 commit 03fb89a

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

JsonPatch/JsonPatch.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,15 +83,27 @@ public override int GetHashCode()
8383
}
8484
}
8585

86+
/// <summary>
87+
/// Provides JSON conversion logic for <see cref="JsonPatch"/>.
88+
/// </summary>
8689
public class PatchJsonConverter : JsonConverter<JsonPatch>
8790
{
91+
/// <summary>Reads and converts the JSON to type <see cref="JsonPatch"/>.</summary>
92+
/// <param name="reader">The reader.</param>
93+
/// <param name="typeToConvert">The type to convert.</param>
94+
/// <param name="options">An object that specifies serialization options to use.</param>
95+
/// <returns>The converted value.</returns>
8896
public override JsonPatch Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
8997
{
9098
var operations = JsonSerializer.Deserialize<List<PatchOperation>>(ref reader, new JsonSerializerOptions { PropertyNamingPolicy = JsonNamingPolicy.CamelCase })!;
9199

92100
return new JsonPatch(operations);
93101
}
94102

103+
/// <summary>Writes a specified value as JSON.</summary>
104+
/// <param name="writer">The writer to write to.</param>
105+
/// <param name="value">The value to convert to JSON.</param>
106+
/// <param name="options">An object that specifies serialization options to use.</param>
95107
public override void Write(Utf8JsonWriter writer, JsonPatch value, JsonSerializerOptions options)
96108
{
97109
JsonSerializer.Serialize(writer, value.Operations);

tools/ApiDocsGenerator/release-notes/rn-json-patch.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ title: JsonPatch.Net
44
icon: fas fa-tag
55
order: "8.08"
66
---
7+
# [2.1.0](https://github.com/gregsdennis/json-everything/pull/472) {#release-patch-2.1.0}
8+
9+
[#471](https://github.com/gregsdennis/json-everything/issues/397) - Make patch json converter public to support .Net source generation. Thanks to [@pwelter34](https://github.com/pwelter34) for highlighting this use case.
10+
711
# [2.0.6](https://github.com/gregsdennis/json-everything/pull/400) {#release-patch-2.0.6}
812

913
[#397](https://github.com/gregsdennis/json-everything/issues/397) - Fixed an issue where `replace` needs to check that the target location exists before proceeding with the `add` portion of its operation.

0 commit comments

Comments
 (0)