Skip to main content

diff_paths

Function diff_paths 

Source
pub fn diff_paths(old: &Value, new: &Value) -> Vec<DiffEntry>
Expand description

Recursively compare old and new and return every leaf that differs.

  • Objects recurse by key; keys present only in new appear as (path, new_value); keys present only in old appear as (path, Null).
  • Arrays recurse index-by-index up to the longer length; indices beyond the shorter length appear as additions or removals.
  • Primitives compare by value.

Paths never include a leading dot; the root is the empty string and is never emitted on its own.