public final class ContractJsonExporter extends Object
LineageDocument
(lineage2-contract.md §2): same input + same engine version =>
byte-identical output.
Documented sort keys (applied by this exporter, regardless of model construction order):
statementIndex ascending;role, then
axis, then statementIndex. Ties preserve
construction order (stable sort);statementIndex ascending;Output format matches json.dumps(doc, indent=2,
ensure_ascii=False) of the gold-fixture generator: two-space indent,
": " key separator, non-ASCII characters emitted raw,
contractVersion as the first key (consumers may short-circuit
parse). No trailing newline (callers append one when writing files).
Key-emission conventions pinned by the gold fixtures:
diagnostics omitted when empty;"sourceLocation": null +
"locationNullReason"; both absent → keys omitted;sourceLocation and
locationNullReason keys (one of the two null);caseBranch always present (null when not a CASE
edge); transformation omitted when null.Internal API: not part of the public gsqlparser surface.
| Modifier and Type | Method and Description |
|---|---|
static String |
toJson(LineageDocument document)
Serialize
document to deterministic contract JSON. |
public static String toJson(LineageDocument document)
document to deterministic contract JSON.