{"id":37053391,"url":"https://github.com/cocoar-dev/cocoar.json.mutable","last_synced_at":"2026-01-14T06:01:20.430Z","repository":{"id":324400465,"uuid":"1093656239","full_name":"cocoar-dev/Cocoar.Json.Mutable","owner":"cocoar-dev","description":null,"archived":false,"fork":false,"pushed_at":"2025-11-15T16:08:27.000Z","size":46,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"develop","last_synced_at":"2025-11-15T16:25:16.120Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cocoar-dev.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":"NOTICE","maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-10T16:58:23.000Z","updated_at":"2025-11-15T16:05:36.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/cocoar-dev/Cocoar.Json.Mutable","commit_stats":null,"previous_names":["cocoar-dev/cocoar.json.mutable"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/cocoar-dev/Cocoar.Json.Mutable","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cocoar-dev%2FCocoar.Json.Mutable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cocoar-dev%2FCocoar.Json.Mutable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cocoar-dev%2FCocoar.Json.Mutable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cocoar-dev%2FCocoar.Json.Mutable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cocoar-dev","download_url":"https://codeload.github.com/cocoar-dev/Cocoar.Json.Mutable/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cocoar-dev%2FCocoar.Json.Mutable/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28412181,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T05:26:33.345Z","status":"ssl_error","status_checked_at":"2026-01-14T05:21:57.251Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-14T06:01:19.744Z","updated_at":"2026-01-14T06:01:20.423Z","avatar_url":"https://github.com/cocoar-dev.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cocoar.Json.Mutable\r\n\r\n**Fast. Mutable. Merge-Focused.**\r\n\r\nA high-performance mutable JSON document object model (DOM) optimized for merging multiple JSON objects efficiently. Built on UTF-8 byte arrays for zero-overhead string handling.\r\n\r\n## Why Use This?\r\n\r\n**Problem:** Most JSON libraries either:\r\n- Offer immutable structures (hard to modify/merge)\r\n- Use managed strings (overhead for large documents)\r\n- Lack efficient deep-merge capabilities\r\n\r\n**Solution:** `Cocoar.Json.Mutable` provides a mutable JSON DOM that:\r\n- Stores content as UTF-8 `byte[]` for performance\r\n- Supports efficient deep merging of JSON objects\r\n- Allows in-place modifications\r\n- No security overhead from memory zeroing\r\n\r\n## Key Features\r\n\r\n✅ **Mutable JSON structure** - Create, modify, and merge JSON documents in-memory  \r\n✅ **UTF-8 native** - Works directly with UTF-8 bytes using `ReadOnlySpan\u003cbyte\u003e` and `ReadOnlyMemory\u003cbyte\u003e`  \r\n✅ **Efficient deep merge** - Merge multiple JSON objects with recursive merging  \r\n✅ **High performance** - No unnecessary memory zeroing or security overhead  \r\n✅ **Built on System.Text.Json** - Uses `Utf8JsonReader` and `Utf8JsonWriter`  \r\n✅ **Provider-friendly** - Accepts `ReadOnlyMemory\u003cbyte\u003e` from data providers\r\n\r\n## Quick Start\r\n\r\n```csharp\r\nusing Cocoar.Json.Mutable;\r\n\r\n// Create an empty document\r\nvar doc = new MutableJsonObject();\r\n\r\n// Parse from ReadOnlySpan\u003cbyte\u003e or ReadOnlyMemory\u003cbyte\u003e\r\nvar config1 = MutableJsonDocument.Parse(\"{\\\"server\\\": {\\\"port\\\": 8080}}\"u8);\r\nvar config2 = MutableJsonDocument.Parse(\"{\\\"server\\\": {\\\"host\\\": \\\"localhost\\\"}, \\\"debug\\\": true}\"u8);\r\n\r\n// Or from ReadOnlyMemory\u003cbyte\u003e (perfect for providers!)\r\nReadOnlyMemory\u003cbyte\u003e memoryFromProvider = GetJsonFromProvider();\r\nvar config3 = MutableJsonDocument.Parse(memoryFromProvider);\r\n\r\n// Merge them together\r\nMutableJsonMerge.Merge(doc, (MutableJsonObject)config1);\r\nMutableJsonMerge.Merge(doc, (MutableJsonObject)config2);\r\n\r\n// Result: {\"server\": {\"port\": 8080, \"host\": \"localhost\"}, \"debug\": true}\r\n\r\n// Developer-friendly string API\r\ndoc.Set(\"version\", new MutableJsonString(\"1.0.0\"));\r\ndoc.Set(\"maxConnections\", new MutableJsonNumber(100));\r\ndoc.Set(\"enabled\", new MutableJsonBool(true));\r\n\r\n// Get values using strings (much easier!)\r\nvar serverNode = doc.Get(\"server\") as MutableJsonObject;\r\nvar port = serverNode?.Get(\"port\") as MutableJsonNumber;\r\n\r\n// Or use UTF-8 bytes for zero allocations\r\nvar versionNode = doc.Get(\"version\"u8);\r\n\r\n// Serialize to JSON\r\nvar jsonBytes = MutableJsonDocument.ToUtf8Bytes(doc);\r\n```\r\n\r\n## Merge Strategies\r\n\r\n```csharp\r\n// Non-destructive merge (clones source values)\r\nMutableJsonMerge.Merge(target, source);\r\n\r\n// Destructive merge (moves source values, faster)\r\nMutableJsonMerge.MergeDestructive(target, source);\r\n\r\n// Clone nodes when needed\r\nvar cloned = MutableJsonMerge.Clone(original);\r\n```\r\n\r\n## Use Cases\r\n\r\n- Configuration merging (base config + environment overrides + user settings)\r\n- API response aggregation\r\n- JSON document transformations\r\n- Building complex JSON structures programmatically\r\n\r\n## When NOT to Use This\r\n\r\n- If you need immutable JSON structures (use System.Text.Json.JsonDocument)\r\n- If you're handling sensitive data that must be securely erased from memory (this library does NOT provide memory zeroing)\r\n- If you only need to read JSON once without modifications (use Utf8JsonReader directly)\r\n- If you need thread-safe concurrent access (this library is NOT thread-safe - use external synchronization if sharing instances across threads)\r\n\r\n## License\r\n\r\nSee [LICENSE](LICENSE) file for details.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcocoar-dev%2Fcocoar.json.mutable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcocoar-dev%2Fcocoar.json.mutable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcocoar-dev%2Fcocoar.json.mutable/lists"}