Jadipa is a JSON DiffPatch project centered on standards-based JSON document mutation.
The Rust core currently provides JSON Pointer support (RFC 6901), JSON Patch support (RFC 6902), JSON Patch diff generation, and JSON Merge Patch support (RFC 7396). The .NET binding exposes the patch, diff, and merge patch APIs through a NuGet package backed by native Rust binaries.
crates/core: Rust library for JSON pointers, JSON Patch, JSON Patch diff generation, and JSON Merge Patch.crates/ffi: FFI layer used to expose core functionality to bindings.bindings/dotnet/Jadipa: .NET package project.bindings/dotnet/Jadipa.Tests: .NET binding tests.
- Rust toolchain with Cargo
- .NET SDK 10.x
boltffi_cliwhen regenerating bindings
cargo install boltffi_cliRun the Rust test suite:
cargo test --all-featuresBuild the native FFI library for the current platform:
cargo build -p jadipa-ffi --releaseRegenerate the C# binding code after changing the FFI surface:
cd crates/ffi
boltffi generate csharpPack the NuGet package:
cd bindings/dotnet/Jadipa
dotnet pack --configuration Release --output packages/Run the .NET tests:
cd bindings/dotnet/Jadipa.Tests
dotnet testThe NuGet package includes native assets for osx-arm64, osx-x64, linux-x64, linux-arm64, and win-x64. CI builds those native binaries before packing the package.
The .NET package exposes:
Jadipa.Patch.ApplyJson(string targetJson, string patchJson)
Jadipa.Diff.DiffJson(string sourceJson, string targetJson)
Jadipa.MergePatch.ApplyJson(string targetJson, string patchJson)Patch.ApplyJson and MergePatch.ApplyJson return the patched JSON as a compact string. Diff.DiffJson returns a compact JSON Patch operation array that transforms sourceJson into targetJson; the generated patch uses add, remove, and replace operations.
The methods throw JadipaErrorException for invalid JSON, invalid patch documents, patch application failures where applicable, or serialization failures. Patch.ApplyJson expects a JSON Patch operation array. MergePatch.ApplyJson expects any valid JSON Merge Patch value.