Package org.mockserver.llm.drift
Class StructuralShapeDiff
java.lang.Object
org.mockserver.llm.drift.StructuralShapeDiff
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).
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classThe structural delta between a recorded ("baseline") and a live document. -
Method Summary
Modifier and TypeMethodDescriptiondiff(com.fasterxml.jackson.databind.JsonNode baseline, com.fasterxml.jackson.databind.JsonNode live) Diff the shapes ofbaseline(recorded) andlive.
-
Method Details
-
diff
public static StructuralShapeDiff.ShapeDiff diff(com.fasterxml.jackson.databind.JsonNode baseline, com.fasterxml.jackson.databind.JsonNode live) Diff the shapes ofbaseline(recorded) andlive. A null node is treated as an empty shape.
-