json_diff
Read-onlyIdempotent
Compute a deep structural diff between two JSON values. Returns added, removed, and changed keys with dot-notation paths. Like git diff but for JSON objects, for API response regression testing. Arrays are not compared blindly by position: the same elements in a different order collapse to a single "reordered" change, and an array of records sharing a stable identity field (id, uuid, key, name…) is matched by that field, so paths read [id=42] and a moved record is not reported as N rewrites.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| after | Yes | The modified JSON (after) — a JSON string, or the value itself. | |
| before | Yes | The original JSON (before) — a JSON string, or the value itself. | |
| max_depth | No | Max nesting depth to recurse (default: 10) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| added | No | ||
| changes | No | ||
| removed | No | ||
| modified | No | ||
| identical | No | ||
| total_changes | No |