Skip to main content

diff

Function diff 

Source
pub fn diff(base: &Value, candidate: &Value, schema: &SdlDocument) -> DiffResult
Expand description

Compute the diff between a base document and a candidate document.

§Normalization

The candidate is automatically normalized against the base before diffing. This ensures that “missing = no change” is correctly interpreted.

§Paths

Paths use canonical form with identity keys when the SDL provides them.

§Arguments

  • base - The reference document.
  • candidate - The document to compare against base.
  • schema - The SDL document (provides identity rules for path resolution).

§Returns

A DiffResult containing all detected changes.