Repository navigation
automerge-cpp v0.6.0 — Full JSON Ecosystem & Logic Refinement
This release completes the extensive nlohmann/json integration (Phases 12B–12G), making Automerge documents first-class citizens in the JSON ecosystem. It also introduces critical stability fixes for type conversions and pointer-based navigation.
Complete nlohmann/json Integration
Automerge documents now support the full suite of JSON standards for path-based access and batch manipulation.
JSON Pointer, Patch, & Merge Patch
-
JSON Pointer (RFC 6901): Deeply address any value using string paths (e.g.,
/users/0/name). Includes full support for~0and~1escaping. -
am::json::get_pointer,am::json::put_pointer,am::json::delete_pointer. -
JSON Patch (RFC 6902): Apply atomic batches of
add,remove,replace,move,copy, andtestoperations. -
am::json::apply_json_patchandam::json::diff_json_patch. -
JSON Merge Patch (RFC 7386): Update documents using simple "null-means-delete" semantics, perfect for partial state synchronization.
-
am::json::apply_merge_patchandam::json::generate_merge_patch.
Lossless Import & Export
- Recursive Export:
am::json::export_jsonnow fully resolves nestedObjIds, materializing complex Automerge trees into standard JSON objects and arrays. - Flatten/Unflatten: Convert nested documents into flat maps of
pointer_path -> valuefor easier debugging or structured configuration management.
Namespace & API Refactoring
To ensure long-term maintainability and prevent name collisions, the JSON API has been structured into two distinct layers:
namespace automerge_cpp(am::): Contains only ADL-basedto_jsonandfrom_jsonoverloads. This is required for C++ Argument-Dependent Lookup to find converters automatically when writingjson j = my_value;.namespace automerge_cpp::json(am::json::): Contains all explicit interop functions (Import, Export, Pointer, Patch).
Critical Fixes & Stability
Core Logic Improvements
- Uninitialized Index Fix: Resolved a critical bug in
add_value_at_pointerwhere an uninitializedstd::size_tvariable could lead to non-deterministic list insertion points. - Loop Variable Overflow: Fixed a potential crash in Base64 decoding where an
unsigned charloop variable was too narrow for the character lookup table. - Recursive Deadlock Prevention: Fixed a "Resource deadlock avoided" error. All JSON write functions now use internal Transaction read methods that bypass
shared_mutexacquisition when already inside a transaction.
Serializer Fidelity
- Unsigned Integer ADL: Reordered type inference in
from_jsonto correctly distinguish betweenuint64andint64based on value range, ensuring larger-than-int64 values are not truncated.
Release Statistics
- Version: 0.6.0
- Tests: 583 passing tests (an increase of 98 tests covering RFC compliance and edge cases).
- New Documentation: Added the JSON Integration Guide covering all new features with usage examples.