Implements JsonPatch type for computing diffs and applying patches to JSON values, as specified in issue #685. This implementation directly mirrors the existing DynamicPatch API, adapted for JSON’s simpler data model.
| File | Description |
|---|---|
Json.scala |
JSON ADT with DynamicValue interop |
JsonPatch.scala |
Patch operations, diff/apply algorithms |
JsonError.scala |
Error handling |
JsonPatchLawsSpec.scala |
Property-based law tests |
JsonPatchSpec.scala |
Unit tests |
Mirrors DynamicPatch with JSON-specific simplifications:
NumberDelta(BigDecimal) — single numeric delta typeStringEdit — LCS-based string diffingArrayEdit — LCS-based array diffingObjectEdit — field-based object diffingJsonPatchMode — Strict/Lenient/ClobberAll pass property-based tests:
diff(a,b)(a) == Right(b)diff(j,j).isEmpty✅ 20 property-based tests (JsonPatchLawsSpec) ✅ 56+ unit tests (JsonPatchSpec)
/claim #685
Bhaviikkk
@Bhaviikkk
ZIO
@ZIO
John Oluwafemi
@John6150