alterschema
This project implements a language-independent set of formal
transformations to
automatically transform JSON Schema documents across
versions of the specification.
Try the web playground at:
https://alterschema.sourcemeta.com
Coverage
From | To | Type | Status | Description |
---|
2019-09 | 2020-12 | Lossless | Full | JSON Schema 2019-09 to JSON Schema 2020-12 |
draft7 | 2019-09 | Lossless | Full | JSON Schema Draft 7 to JSON Schema 2019-09 |
draft6 | draft7 | Lossless | Full | JSON Schema Draft 6 to JSON Schema Draft 7 |
draft4 | draft6 | Lossless | Full | JSON Schema Draft 4 to JSON Schema Draft 6 |
draft3 | draft4 | Lossless | Minimal 1 | JSON Schema Draft 3 to JSON Schema Draft 4 |
Transformations are transitively applied. For example, transforming from
draft6
to 2019-09
implies transforming draft6
to draft7
and draft7
to
2019-09
.
Bindings
JavaScript
const alterschema = require('alterschema')
const result = await alterschema({ ... }, '2019-09', '2020-12')
console.log(result)
Command-line tool
npm install --global alterschema
alterschema --from <from> --to <to> path/to/schema.json
Others
We accept contributions to implement alterschema
in any programming language.
To produce an alterschema
implementation, your programming language of choice
must support a JSON Schema 2020-12 validator and a
JSON-e interpreter.
Acknowledgements
Special thanks to @gregdeniss for curating
the initial set of upgrade rules.