Skip to content
Edith

Docs

Command reference

ed spec-compare compare

The ed command line

Compare a base and revision contract without sending API requests.

Terminal
ed spec-compare compare /tmp/base.yaml /tmp/revision.yamled spec-compare compare /tmp/base.json /tmp/revision.json --json

Both arguments must be absolute paths to regular local .json, .yaml or .yml files, each at most 8 MiB. Symlinks are resolved, and reports name the resolved physical path. OpenAPI 3.0.x and 3.1.x are supported in JSON or YAML. The installed analyzer must be oasdiff 1.37.0 or later in the 1.x series. Install it separately with brew install oasdiff if needed, then retry.

The default output is deterministic Markdown. --json returns base, revision, analyzer, operations and documentFindings. Operations have group (added, removed or changed), method, path, findings, baseSource and revisionSource. Findings preserve the analyzer rule id, text, numeric level, and source locations where supplied. Level 3 is breaking, 2 is warning and 1 is information. Source links carry a line fragment or an OpenAPI JSON pointer when a precise line is unavailable. File paths are included in reports, so review them before sharing.

Operations and findings are sorted. Reports contain no timestamps. With unchanged files, analyzer version and paths, repeated comparisons produce identical Markdown. Unchanged operations are omitted. Changes outside operations appear under document findings. A changed operation with no consumer rule receives a definition finding.

Unresolved internal references, any external file or URL references, unsupported versions and invalid documents fail the comparison. A validation failure names the side (Base or Revision), file, line and column and the analyzer rule text. Each analyzer command has a 30 second deadline and a 64 MiB output limit. The terminal reply is limited to 4 MiB, so very large reports are refused. Comparison does not modify contracts, install tools, follow server URLs or load local oasdiff configuration.

Exit code Meaning
0 The report was printed.
1 The comparison failed: an invalid, unsupported or oversized contract, or an analyzer error.
2 The command line was wrong, such as a missing argument.
3 A contract path does not exist.
4 oasdiff is not installed. The hint names brew install oasdiff.