A language-independent tool to automatically transform JSON Schema documents across specification versions (Draft 3 to 2020-12). Version 1.1.3 is the latest stable release. Developed by Sourcemeta, it provides lossless, transitive transformations and a JavaScript binding. Differentiates from other converters by offering formal one-to-one rule mappings and a web playground at alterschema.sourcemeta.com. Supports lossless upgrades from 2019-09 to 2020-12, Draft 7 to 2019-09, etc. Designed for compatibility with JSON Schema validators.
npm install alterschemaNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Converts a JSON Schema from 2019-09 to 2020-12 using the alterschema function.
Use await alterschema(...) or .then()
Add "$schema": "<from-version-url>" to your schema.
Check issues for draft3 support; consider manual migration.
Create your own .d.ts or use `// @ts-ignore`
Use the npm package or CLI for Node.js.
Use `import alterschema from 'alterschema'` or `const alterschema = require('alterschema')`Add `$schema: 'https://json-schema.org/...` to your schema object
Use the exact version identifier: 'draft3', 'draft4', 'draft6', 'draft7', '2019-09', '2020-12'
Ensure you use `await alterschema(...)` or chain `.then()`