A high-performance, low-memory JSON diff and patch library for System.Text.Json with RFC 6902 support.
SystemTextJson.JsonDiffPatch is a .NET library that computes differences between JSON objects and generates patches, using System.Text.Json for high performance and low memory usage. It solves the problem of efficiently detecting and applying changes in JSON data, which is essential for versioning, synchronization, and testing workflows.
.NET developers working with JSON data who need reliable diffing, patching, or semantic comparison capabilities, particularly in applications like APIs, configuration management, or automated testing.
Developers choose it for its optimized performance with large JSON documents, native System.Text.Json integration, and support for standard formats like RFC 6902, making it a modern alternative to older Newtonsoft.Json-based libraries.
High-performance, low-allocating JSON object diff and patch extension for System.Text.Json. Support generating patch document in RFC 6902 JSON Patch format.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Optimized for fast diffing of large JSON documents with minimal memory allocation, as detailed in the provided benchmark results, showing efficiency for substantial data.
Generates patch documents compliant with RFC 6902 JSON Patch format, ensuring interoperability with other systems that follow this standard for JSON patching.
Uses Longest Common Subsequence (LCS) and custom matchers to detect moves and changes in arrays, improving accuracy for complex data structures as highlighted in the features.
Provides assertion helpers for xUnit, MSTest v2, and NUnit with detailed delta output, making it easy to integrate JSON comparisons in tests, as shown in the example output.
Includes JsonValueComparer and DeepEquals methods for semantic JSON value comparison, such as treating numbers and dates equivalently, which aids in accurate equality checks.
Features like long text diffing using google-diff-match-patch are only available when not using RFC 6902 format, limiting flexibility in scenarios requiring both standards compliance and advanced text diffing.
Built exclusively on System.Text.Json, it doesn't seamlessly integrate with projects heavily dependent on Newtonsoft.Json, potentially requiring migration efforts or dual-library setups.
The library offers many options like custom array matchers and diff algorithms, which can increase setup complexity and learning curve for developers new to diffing concepts.
SystemTextJson.JsonDiffPatch is an open-source alternative to the following products: