Schema contract lifecycle for OpenAPI, JSON Schema, and AsyncAPI
Linting • Breaking change detection • Versioning • Release automation
Supported Formats: OpenAPI, JSON Schema, AsyncAPI
-
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, JSON Schema, and AsyncAPI. 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.mdnpm install -g @contractual/cliOr with other package managers:
pnpm add -g @contractual/cli
yarn global add @contractual/cli- 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
