Schema contract lifecycle for OpenAPI and JSON Schema
Linting • Breaking change detection • Versioning • Release automation
Supported Formats: OpenAPI, JSON Schema
-
Structural Breaking Change Detection - Compares specs against versioned snapshots using structural diffing, not string comparison. Catches removed fields, type changes, and endpoint deletions.
-
Automated Versioning - Changesets declare bump levels (major/minor/patch).
contractual versionconsumes them, bumps versions, updates snapshots, and generates changelogs. -
CI Integration - GitHub Action posts diff tables on PRs, auto-generates changesets, and opens Version PRs for release automation.
-
Format Agnostic - Works with OpenAPI and JSON Schema. Custom linters and differs can be configured per contract.
$ contractual diff
orders-api: 3 changes (2 breaking, 1 non-breaking) — suggested bump: major
BREAKING Removed endpoint GET /orders/{id}/details
BREAKING Changed type of field 'amount': string → number
non-breaking Added optional field 'tracking_url'$ contractual changeset ? Bump type for orders-api: major ? Summary: Remove deprecated endpoint, change amount type Wrote .contractual/changesets/fuzzy-lion-dances.md
$ contractual version orders-api 1.4.2 → 2.0.0 (major) Updated .contractual/versions.json Updated CHANGELOG.md
Beta releases are currently available under the npm beta tag. There is no stable release yet. Built-in linting and diffing support OpenAPI and JSON Schema; AsyncAPI and ODCS require custom engines. AI, fixed versioning, and generation hooks are planned. See release scope and contributing.
npm install -g @contractual/cli@beta
Or with other package managers:
pnpm add -g @contractual/cli@beta yarn global add @contractual/cli@beta
- Initialize -
contractual initscans for specs and createscontractual.yaml - Lint -
contractual lintvalidates specs - Detect changes -
contractual diffshows all changes classified - CI gate -
contractual breakingfails if breaking changes exist - Version -
contractual changeset+contractual versionfor releases
