Class StructuralShapeDiff

java.lang.Object
org.mockserver.llm.drift.StructuralShapeDiff

public final class StructuralShapeDiff extends Object
Compares two JSON documents by shape — the set of field paths and their value types — ignoring values. Used by drift detection to spot structural changes in a provider's responses (new/removed fields, type changes) without flagging benign value differences.

Pure and deterministic. Object fields are walked by name; arrays are represented by a single [] path segment using the first element's shape (a representative-element model — sufficient for detecting field/type drift in homogeneous provider responses).

  • Method Details

    • diff

      public static StructuralShapeDiff.ShapeDiff diff(com.fasterxml.jackson.databind.JsonNode baseline, com.fasterxml.jackson.databind.JsonNode live)
      Diff the shapes of baseline (recorded) and live. A null node is treated as an empty shape.