Migrate JSON Schema Draft
Upgrade an older JSON Schema to draft 2020-12. definitions becomes $defs with $refs repointed, boolean exclusiveMinimum becomes numeric, tuple items arrays become prefixItems, and dependencies splits into dependentRequired and dependentSchemas. Every change is listed in the status bar.
How to migrate a JSON Schema to draft 2020-12
- Paste your existing schema. The declared
$schemais reported so you can confirm what you started from. - Pick the target draft — 2020-12 unless a tool in your stack is pinned to 2019-09.
- Read the change list in the status bar. Every rewrite is named with the path it happened at.
- Validate a known-good document against the migrated schema with Schema validator before replacing the original.
- Copy or download the migrated schema.
Every rewrite it performs
id→$id(draft-04 spelled it without the dollar).definitions→$defs, and any$refof the form#/definitions/Xrepointed to#/$defs/X.- Boolean exclusive bounds → numeric. Draft-04's
{"minimum": 5, "exclusiveMinimum": true}becomes{"exclusiveMinimum": 5}. - Tuple validation →
items: [A, B]becomesprefixItems: [A, B], andadditionalItemsbecomes the newitems. dependencies→ split by value type intodependentRequired(arrays) anddependentSchemas(objects).divisibleBy→multipleOf, and draft-06'sconstant→const.- draft-03
required: trueon a property is dropped, with a note — 2020-12 lists required keys on the parent instead. $schemaset to the target draft's URI, and$schema/$id/titlemoved to the top for readability.
What you still have to check by hand
Two 2020-12 changes are behavioural rather than syntactic, so no tool can fix them for you:
$refsiblings now apply. In draft-07 and earlier, keywords next to a$refwere ignored. In 2019-09 and later they are evaluated. If your schema relied on the old behaviour — for example a$refwith atypebeside it that used to be dead weight — the meaning changes.- Unevaluated keywords.
unevaluatedPropertiesandunevaluatedItemsare new and interact withallOfcomposition in ways thatadditionalPropertiesdid not. Schemas that usedadditionalProperties: falseinside anallOfbranch often need rethinking.
Test with real documents. A migrated schema that parses is not necessarily a schema that means the same thing.
Privacy
Nothing is uploaded. The conversion runs in this tab using your own browser's JavaScript engine — no server sees your data, and the page keeps working with the network disconnected.
FAQ
Can it migrate downwards, 2020-12 to draft-07?
No. Downgrading loses expressiveness — there is no draft-07 equivalent for prefixItems with a separate items, or for the unevaluated keywords. If a tool needs draft-07, keep a hand-maintained version.
Which validators support 2020-12?
Ajv 8 (with the 2020 entry point), python-jsonschema 4+, and most actively maintained libraries. Ajv 6 and older are draft-07 only. Our Schema validator handles 04 through 2020-12.
Does it change my validation logic?
It aims not to, and every rewrite it makes is a like-for-like translation. The two behavioural changes above are the exception, which is why they are called out rather than silently patched.