Skip to content

Releases: cocoar-dev/Cocoar.Json.Mutable

v1.2.0

Choose a tag to compare

@windischb windischb released this 01 Jun 06:31

Added

  • Add MutableJsonPath with GetAtPath, SetAtPath, and RemoveAtPath for nested object traversal using explicit path segments

v1.1.0

Choose a tag to compare

@windischb windischb released this 01 Jun 05:17

Added

  • Add MutableJsonMergeOptions.PropertyNameCaseInsensitive for opt-in case-insensitive property-name matching during Merge and MergeDestructive

v1.0.1

Choose a tag to compare

@windischb windischb released this 20 Mar 15:03

What's Changed

Performance Fixes

Eliminated unnecessary double allocations in three hot paths:

  • Number parsing: MutableJsonNumber values were copied twice during parsing — once by the parser (ValueSpan.ToArray()) and again by the constructor (rawUtf8.ToArray()). Now uses FromOwned to skip the redundant copy.
  • Number cloning: Same double-copy issue when cloning MutableJsonNumber nodes via MutableJsonMerge.Clone().
  • Property name parsing: Every property name was allocated twice — once by the parser and again inside Set(). A new internal SetOwned method takes direct ownership of the byte array.

These fixes reduce allocations per parsed JSON document proportional to the number of numeric values and properties.

Documentation

  • Added full VitePress documentation site at docs.cocoar.dev/json-mutable
  • Added manual docs deployment workflow (05-deploy-docs.yml)
  • Auto-deploy docs on stable release via 04-publish-stable.yml
  • Added path filters to PR validation and develop build workflows to skip unnecessary builds on documentation-only changes

Full Changelog: v1.0.0...v1.0.1

v1.0.0

Choose a tag to compare

@windischb windischb released this 15 Nov 16:08

Cocoar.Json.Mutable v1.0.0 - Initial Release

First stable release of Cocoar.Json.Mutable - a high-performance mutable JSON DOM optimized for efficient merging.

What's New

  • Mutable JSON document object model with UTF-8 byte storage
  • Efficient deep merge operations (Merge and MergeDestructive)
  • Clone functionality for deep copying JSON nodes
  • Core types: MutableJsonObject, MutableJsonArray, and primitives
  • Parse and serialize using System.Text.Json
  • Developer-friendly string API alongside UTF-8 byte API
  • Support for ReadOnlyMemory<byte> from data providers
  • 15 comprehensive unit tests

Installation

dotnet add package Cocoar.Json.Mutable

Quick Example

using Cocoar.Json.Mutable;

var config1 = MutableJsonDocument.Parse("{\"server\": {\"port\": 8080}}"u8);
var config2 = MutableJsonDocument.Parse("{\"server\": {\"host\": \"localhost\"}, \"debug\": true}"u8);

var result = new MutableJsonObject();
MutableJsonMerge.Merge(result, (MutableJsonObject)config1);
MutableJsonMerge.Merge(result, (MutableJsonObject)config2);
// Result: {"server": {"port": 8080, "host": "localhost"}, "debug": true}

Notes

  • ⚠️ Not thread-safe - use external synchronization for concurrent access
  • Built for .NET 8.0
  • Perfect for configuration merging, API response aggregation, and JSON transformations

See the README for full documentation.