JSON / Nested leaf merge

JSON Nested Object Leaf Merge

This page has a stable URL for review, documentation, and implementation comparison. The fixture tabs show merge inputs and output; the contract tabs show JSON and compact ruleset renderings with stable IDs and deterministic ownership.

Advanced .json advanced leaf mergenested leavesdestination leaf winsjsonnested_object_leavesstable_pathnative_read_portable_writelayout_only

Fixture sources

JSON fixture: structuredmerge-fixtures/json/slice-720-advanced-leaf-merge/nested-object-leaf-merge.json

Compact ruleset: structuredmerge-fixtures/rulesets/json/slice-720-advanced-leaf-merge/nested-object-leaf-merge.smrules

Fixture view
{
  "patient": {
    "demographics": {
      "name": {"given": "Pat", "family": "Template"},
      "contact": {"email": "[email protected]", "phone": "555-0100"}
    },
    "care_plan": {
      "status": "draft",
      "goals": {"mobility": "walk daily", "nutrition": "low sodium"}
    }
  }
}
Contract view
{
  "contract_id": "json-nested-object-leaf-merge",
  "format": "json",
  "owners": "nested_object_leaves",
  "match": "stable_path",
  "read": "native_read_portable_write",
  "attach": "layout_only",
  "render": "json_object_pairs",
  "capabilities": {
    "nested_leaf_merge": true,
    "destination_leaf_wins": true,
    "template_missing_leaf_adds": true
  }
}