system-text-json-jsondiffpatch
system-text-json-jsondiffpatch copied to clipboard
High-performance, low-allocating JSON object diff and patch extension for System.Text.Json. Support generating patch document in RFC 6902 JSON Patch format.
Noticed that the diff of arrays was not always correct when items were removed, modified and added. The modifications where not identified. **example:** Lets assume I want to diff the...
**Is your feature request related to a problem? Please describe.** I want to minimise dependencies in my project by utilising framework dependencies wherever possible **Describe the solution you'd like** I...
[xUnit.net 00:00:00.32] Imageflow.Test.TestJson.TestAllJob [FAIL] Failed Imageflow.Test.TestJson.TestAllJob [186 ms] Error Message: System.Text.Json.JsonDiffPatch.Xunit.JsonEqualException : JsonAssert.Equal() failure. Stack Trace: at System.Text.Json.JsonDiffPatch.Xunit.JsonAssert.HandleEqual(JsonNode expected, JsonNode actual, JsonDiffOptions diffOptions, Func`2 outputFormatter) at System.Text.Json.JsonDiffPatch.Xunit.JsonAssert.Equal[T](T expected, T actual)...
## New features and updates [`522be95`](https://github.com/weichch/system-text-json-jsondiffpatch/pull/42/commits/522be95) add debug symbols and explicit packable configuration to `src/Directory.build.props` [`f1fd5d7`](https://github.com/weichch/system-text-json-jsondiffpatch/pull/42/commits/f1fd5d7) add explicit `SourceLink.GitHub` package reference [`31bd648`](https://github.com/weichch/system-text-json-jsondiffpatch/pull/42/commits/31bd648) add msbuild properties for `SourceLink` [`e72126c`](https://github.com/weichch/system-text-json-jsondiffpatch/pull/42/commits/e72126c) upgrade packages...
Once the two APIs are available in newer version of `System.Text.Json`, the two custom made methods should be decommissioned (if possible). Track progress in https://github.com/dotnet/runtime/issues/56592. Also related this https://github.com/dotnet/runtime/issues/33388.
Is it intended, or could there be some other flag to enforce it?
Steps to reproduce: ``` JsonDiffPatcher.DefaultOptions = () => new JsonDiffOptions { SuppressDetectArrayMove = true }; var x = JsonDocument.Parse(@"{""a"":[{""b"":1},{""b"":2}]}"); var y = JsonDocument.Parse(@"{""a"":[{""b"":1},{""b"":2}]}"); var z = JsonDocument.Parse(@"{""a"":[{""b"":2},{""b"":1}]}"); var test1 =...
I'm confused about how to preserve missing values from when `diff`ing two objects. Take for example these two json blocks: ```json { "Name": "John", "Age": 34, "Origin": "Scotland", "Pets": [...
With the following code (excluded the usings for simplicity) ``` var node1 = JsonNode.Parse("{\"foo\":[ {\"bar1\": \"res1\"} ]}"); var node2 = JsonNode.Parse("{\"foo\":[ {\"bar1\": \"res2\"} ]}"); var x = JsonDiffPatcher.Diff(node1, node2, new...