SystemTextJson.JsonDiffPatch alternatives and similar packages
Based on the "Misc" category.
Alternatively, view system-text-json-jsondiffpatch alternatives based on common mentions on social networks and blogs.
-
Polly
Polly is a .NET resilience and transient-fault-handling library that allows developers to express policies such as Retry, Circuit Breaker, Timeout, Bulkhead Isolation, and Fallback in a fluent and thread-safe manner. From version 6.0.1, Polly targets .NET Standard 1.1 and 2.0+. -
FluentValidation
A popular .NET validation library for building strongly-typed validation rules. -
MediatR
Simple, unambitious mediator implementation in .NET -
Humanizer
Humanizer meets all your .NET needs for manipulating and displaying strings, enums, dates, times, timespans, numbers and quantities -
Edge.js
Run .NET and Node.js code in-process on Windows, MacOS, and Linux -
CsvHelper
Library to help reading and writing CSV files -
ReactJS.NET
.NET library for JSX compilation and server-side rendering of React components -
Rant
The Rant Procedural Text Generation DSL http://berkin.me/rant/ -
ScriptCS
Write C# apps with a text editor, nuget and the power of Roslyn! -
YoutubeExplode
Abstraction layer over YouTube's internal API -
Hashids.net
A small .NET package to generate YouTube-like hashes from one or many numbers. Use hashids when you do not want to expose your database ids to the user. -
Coravel
Near-zero config .NET library that makes advanced application features like Task Scheduling, Caching, Queuing, Event Broadcasting, and more a breeze! -
Enums.NET
Enums.NET is a high-performance type-safe .NET enum utility library -
Scientist.NET
A .NET library for carefully refactoring critical paths. It's a port of GitHub's Ruby Scientist library -
WorkflowEngine
WorkflowEngine.NET - component that adds workflow in your application. It can be fully integrated into your application, or be in the form of a specific service (such as a web service). -
Jurassic
A .NET library to parse and execute JavaScript code. -
HidLibrary
This library enables you to enumerate and communicate with Hid compatible USB devices in .NET. -
TinyMapper
A quick object-object mapper for .NET -
Warden
Define "health checks" for your applications, resources and infrastructure. Keep your Warden on the watch. -
Guard
A high-performance, extensible argument validation library. -
Aeron.NET
Efficient reliable UDP unicast, UDP multicast, and IPC message transport - .NET port of Aeron -
DeviceId
A simple library providing functionality to generate a 'device ID' that can be used to uniquely identify a computer. -
Jot
Jot is a library for persisting and applying .NET application state. -
ByteSize
ByteSize is a utility class that makes byte size representation in code easier by removing ambiguity of the value being represented. ByteSize is to bytes what System.TimeSpan is to time. -
Streams
A lightweight F#/C# library for efficient functional-style pipelines on streams of data. -
Mediator.Net
A simple mediator for .Net for sending command, publishing event and request response with pipelines supported -
Jering.Javascript.NodeJS
Invoke Javascript in NodeJS, from C# -
LINQPad.QueryPlanVisualizer
SQL Server and PostgreSQL query execution plan visualizer for LINQPad -
DeviceDetector.NET
The Universal Device Detection library will parse any User Agent and detect the browser, operating system, device used (desktop, tablet, mobile, tv, cars, console, etc.), brand and model. -
Valit
Valit is dead simple validation for .NET Core. No more if-statements all around your code. Write nice and clean fluent validators instead! -
FormHelper
ASP.NET Core - Transform server-side validations to client-side without writing any javascript code. (Compatible with Fluent Validation) -
https://github.com/minhhungit/ConsoleTableExt
A fluent library to print out a nicely formatted table in a console application C# -
SystemWrapper
.NET library for easier testing of system APIs. -
SolidSoils4Arduino
C# .NET - Arduino library supporting simultaneous serial ASCII, Firmata and I2C communication -
Validot
Validot is a performance-first, compact library for advanced model validation. Using a simple declarative fluent interface, it efficiently handles classes, structs, nested members, collections, nullables, plus any relation or combination of them. It also supports translations, custom logic extensions with tests, and DI containers. -
Shielded
A strict and mostly lock-free Software Transactional Memory (STM) for .NET -
RecordParser
Zero Allocation Writer/Reader Parser for .NET Core -
Outcome.NET
Never write a result wrapper again! Outcome.NET is a simple, powerful helper for methods that return a value, but sometimes also need to return validation messages, warnings, or a success bit. -
NaturalSort.Extension
๐ Extension method for StringComparison that adds support for natural sorting (e.g. "abc1", "abc2", "abc10" instead of "abc1", "abc10", "abc2"). -
FlatMapper
FlatMapper is a library to import and export data from and to plain text files. -
NIdenticon
NIdenticon is a library for creating simple Identicons -
AzureCrawler
Take HTML Snapshots for your Angular, Ember, Durandal or any JavaScript applications -
BerTlv.NET
A library for parsing BER TLV data (like EMV credit cards). -
trybot
A transient fault handling framework including such resiliency solutions as Retry, Timeout, Fallback, Rate Limit and Circuit Breaker. -
AdaskoTheBeAsT.FluentValidation.MediatR
FluentValidation behavior for MediatR
Access the most powerful time series database as a service
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of SystemTextJson.JsonDiffPatch or a related project?
README
SystemTextJson.JsonDiffPatch
High-performance, low-allocating JSON object diff and patch extension for System.Text.Json.
Features
- Compatible with jsondiffpatch delta format
- Support generating patch document in RFC 6902 JSON Patch format
- Target latest .NET Standard and .NET Framework 4.6.1 (for legacy apps) and leverage latest .NET features
- Alternative to jsondiffpatch.net which is based on Newtonsoft.Json
- Fast large JSON document diffing with less memory consumption (see benchmark)
- Support smart array diffing (e.g. move detect) using LCS (Longest Common Subsequence) and custom array item matcher
- (Only when not using RFC 6902 format) Support diffing long text using google-diff-match-patch, or write your own diff algorithm
- Bonus
DeepEquals
method for comparingJsonDocument
,JsonElement
andJsonNode
- Bonus
DeepClone
method - Bonus
JsonValueComparer
that implements semantic comparison of twoJsonValue
objects - JSON assert for xUnit, MSTest v2 and NUnit with customizable delta output
Install
JsonDiffPatch
PM> Install-Package SystemTextJson.JsonDiffPatch
xUnit Assert
PM> Install-Package SystemTextJson.JsonDiffPatch.Xunit
MSTest v2 Assert
PM> Install-Package SystemTextJson.JsonDiffPatch.MSTest
NUnit Assert
PM> Install-Package SystemTextJson.JsonDiffPatch.NUnit
Usage
Diff
// Diff JsonNode
var node1 = JsonNode.Parse("{\"foo\":\"bar\"}");
var node2 = JsonNode.Parse("{\"baz\":\"qux\", \"foo\":\"bar\"}");
var diff = node1.Diff(node2);
// Diff with options
var diff = node1.Diff(node2, new JsonDiffOptions
{
JsonElementComparison = JsonElementComparison.Semantic
});
// Diff and convert delta into RFC 6902 JSON Patch format
var diff = node1.Diff(node2, new JsonPatchDeltaFormatter());
// Diff JSON files
var diff = JsonDiffPatcher.DiffFile(file1, file2);
// Diff Span<byte>
var diff = JsonDiffPatcher.Diff(span1, span2);
// Diff streams
var diff = JsonDiffPatcher.Diff(stream1, stream2);
// Diff JSON strings
var diff = JsonDiffPatcher.Diff(json1, json2);
// Diff JSON readers
var diff = JsonDiffPatcher.Diff(ref reader1, ref reader2);
Patch & Unpatch
var node1 = JsonNode.Parse("{\"foo\":\"bar\"}");
var node2 = JsonNode.Parse("{\"baz\":\"qux\", \"foo\":\"bar\"}");
var diff = node1.Diff(node2);
// In-place patch
JsonDiffPatcher.Patch(ref node1, diff);
// Clone & patch
var patched = node1.PatchNew(diff);
// In-place unpatch
JsonDiffPatcher.ReversePatch(ref node1, diff);
// Clone & unpatch
var patched = node1.ReversePatchNew(diff);
DeepEquals
// JsonDocument
var doc1 = JsonDocument.Parse("{\"foo\":1}");
var doc2 = JsonDocument.Parse("{\"foo\":1.0}");
var equal = doc1.DeepEquals(doc2);
var textEqual = doc1.DeepEquals(doc2, JsonElementComparison.RawText);
var semanticEqual = doc1.DeepEquals(doc2, JsonElementComparison.Semantic);
// JsonNode
var node1 = JsonNode.Parse("{\"foo\":1}");
var node2 = JsonNode.Parse("{\"foo\":1.0}");
var equal = node1.DeepEquals(node2);
var textEqual = node1.DeepEquals(node2, JsonElementComparison.RawText);
var semanticEqual = node1.DeepEquals(node2, JsonElementComparison.Semantic);
DeepClone
var node = JsonNode.Parse("{\"foo\":\"bar\"}");
var cloned = node.DeepClone();
Default Options
// Default diff options
JsonDiffPatcher.DefaultOptions = () => new JsonDiffOptions
{
JsonElementComparison = JsonElementComparison.Semantic
};
// Default comparison mode for DeepEquals
JsonDiffPatcher.DefaultComparison = JsonElementComparison.Semantic;
Semantic Value Comparison
var node1 = JsonNode.Parse("\"2019-11-27\"");
var node2 = JsonNode.Parse("\"2019-11-27T00:00:00.000\"");
// dateCompare is 0
var dateCompare = JsonValueComparer.Compare(node1, node2);
var node3 = JsonNode.Parse("1");
var node4 = JsonNode.Parse("1.00");
// numCompare is 0
var numCompare = JsonValueComparer.Compare(node3, node4);
Assert (Unit Testing)
var expected = JsonNode.Parse("{\"foo\":\"bar\"}");
var actual = JsonNode.Parse("{\"baz\":\"qux\", \"foo\":\"bar3\"}");
// xUnit
JsonAssert.Equal(expected, actual);
actual.ShouldEqual(expected);
JsonAssert.NotEqual(expected, actual);
actual.ShouldNotEqual(expected);
// MSTest
JsonAssert.AreEqual(expected, actual);
Assert.That.JsonAreEqual(expected, actual);
JsonAssert.AreNotEqual(expected, actual);
Assert.That.JsonAreNotEqual(expected, actual);
// NUnit
JsonAssert.AreEqual(expected, actual);
Assert.That(actual, JsonIs.EqualTo(expected));
JsonAssert.AreNotEqual(expected, actual);
Assert.That(actual, JsonIs.NotEqualTo(expected));
Example output (when output is enabled):
JsonAssert.Equal() failure.
Expected:
{
"foo": "bar"
}
Actual:
{
"baz": "qux",
"foo": "bar"
}
Delta:
{
"foo": [
"bar",
"bar3"
],
"baz": [
"qux"
]
}
Benchmark
See detailed benchmark results.
*Note that all licence references and agreements mentioned in the SystemTextJson.JsonDiffPatch README section above
are relevant to that project's source code only.