migrating-json-schemaslisted
Install: claude install-skill zaggino/z-schema
# Migrating JSON Schemas Between Drafts
z-schema supports draft-04, draft-06, draft-07, draft-2019-09, and draft-2020-12. This skill covers migrating schemas between drafts and verifying them with z-schema.
## Migration workflow
1. Identify the source draft (check `$schema` or `id`/`$id` usage).
2. Set the target version on the validator:
```typescript
import ZSchema from 'z-schema';
const validator = ZSchema.create({ version: 'draft2020-12' });
```
3. Run `validator.validateSchema(schema)` to surface incompatibilities.
4. Fix each reported error using the keyword mapping below.
5. Re-validate until the schema passes.
## Quick reference: keyword changes
| Old keyword (draft-04) | New keyword (draft-2020-12) | Introduced in |
| ------------------------------------ | ------------------------------------ | ------------- |
| `id` | `$id` | draft-06 |
| `definitions` | `$defs` | draft-2019-09 |
| Array-form `items` (tuple) | `prefixItems` | draft-2020-12 |
| `additionalItems` | `items` (when `prefixItems` present) | draft-2020-12 |
| `exclusiveMinimum: true` (boolean) | `exclusiveMinimum: <number>` | draft-06 |
| `exclusiveMaximum: true` (boolean) | `exclusiveMaximum: <number>` | draft-06 |
| `dependencies` (string arrays) | `dependentRe