migrating-json-schemas

Migrate JSON Schemas between draft versions for z-schema compatibility.

349|91|Updated Jul 23, 2013
One-click install
npx skills add https://github.com/zaggino/z-schema --skill migrating-json-schemas
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: migrating-json-schemas
Source: https://github.com/zaggino/z-schema/tree/main/skills/migrating-json-schemas
Command: npx skills add https://github.com/zaggino/z-schema --skill migrating-json-schemas

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Migrates JSON Schemas across drafts (e.g., draft-04 to draft-2020-12) to ensure compatibility with z-schema and modern tooling.

Core Features & Use Cases

  • Convert keywords and structures between drafts (id -> $id, definitions -> $defs, dependencies -> dependentRequired/dependentSchemas, and $recursiveRef/$recursiveAnchor -> $dynamicRef/$dynamicAnchor).
  • Update references and nested schemas to reflect draft changes for cross-version validation and compatibility checks.
  • Use during schema modernization, cross-version validation, and validator preparation for multi-draft schemas.

Quick Start

Upgrade a schema from an older draft to the target draft and re-validate it with ZSchema.

Frequently Asked Questions about migrating-json-schemas

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I migrate JSON Schema draft-04 to draft-2020-12?

Migrate JSON Schema draft-04 to draft-2020-12 by renaming id to $id, moving definitions to $defs, and converting dependencies into dependentRequired and dependentSchemas for z-schema compatibility.

How does converting $recursiveRef to $dynamicRef work in JSON Schema?

Converting $recursiveRef and $recursiveAnchor to $dynamicRef and $dynamicAnchor updates recursive schema references to the dynamic form required by modern JSON Schema drafts for cross-version validation.

When do I need to update JSON Schema definitions to $defs?

Update JSON Schema definitions to $defs during schema modernization when upgrading older drafts to newer versions, ensuring compatibility with modern tooling and z-schema validation standards.

Does z-schema support draft-2020-12 prefixItems validation?

z-schema supports draft-2020-12 compatibility when you migrate older schemas by applying keyword conversions and updating nested structures, enabling prefixItems validation and cross-version checks.

What is the best way to split JSON Schema dependencies for draft-2020-12?

Split JSON Schema dependencies into dependentRequired for property presence constraints and dependentSchemas for conditional schema application to align with draft-2020-12 migration requirements.

Why does my JSON Schema migration fail cross-version validation checks?

JSON Schema migration fails cross-version validation when references and nested schemas are not updated to reflect draft changes, requiring keyword renames and $defs relocation for successful validation.