@corralimited/snapdiff-openapi
Versioned OpenAPI 3.1 specification for the SnapDiff REST API.
Each release of this package corresponds to a specific live-API revision — pin to a version,
codegen against it, and your generated client stays in sync until you bump the dep.
Install
npm install --save-dev @corralimited/snapdiff-openapi
Use as codegen input
npx openapi-typescript node_modules/@corralimited/snapdiff-openapi/openapi.json -o src/snapdiff-types.ts
npx orval --input node_modules/@corralimited/snapdiff-openapi/openapi.json --output src/api/
import createClient from 'openapi-fetch';
import type { paths } from './snapdiff-types';
const client = createClient<paths>({
baseUrl: 'https://api.snapdiff.ai/v1',
headers: { 'X-API-Key': process.env.SNAPDIFF_API_KEY! },
});
const { data, error } = await client.POST('/diff', {
body: { before: 'https://prod.example.com', after: 'https://staging.example.com' },
});
Use the spec object directly
import { openapiSpec } from '@corralimited/snapdiff-openapi';
import spec from '@corralimited/snapdiff-openapi';
console.log(spec.info.version);
Versioning
Follows semver against API behavior:
- Patch — backwards-compatible spec corrections (description tweaks, examples).
- Minor — new endpoints, new optional fields, new optional query params.
- Major — breaking changes (removed endpoints, required fields added, response shape
changes). Major bumps coincide with versioned API roots (
/v1 → /v2).
Live spec
The same spec is also served live at https://api.snapdiff.ai/openapi.json — useful for
exploration. For reproducible CI builds, prefer this package.
License
MIT — see LICENSE.