validating-json-data

Validate JSON data against JSON Schema drafts 04 through 2020-12 using z-schema.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

z-schema makes it possible to ensure JSON data conforms to a JSON Schema across drafts 04 through 2020-12, catching type, required, and structural errors before processing.

Core Features & Use Cases

  • Supports validation against JSON Schema drafts 04, 06, 07, 2019-09, and 2020-12, including remote references.
  • Provides detailed error information including paths, codes, and nested inner errors for complex schemas.
  • Works in sync and async modes, with safe (non-throwing) options and optional schema pre-compilation for performance.
  • Use case: validate API payloads, data migrations, and form submissions to enforce schema compliance across environments.

Quick Start

Create a validator with ZSchema.create() and call validate with a sample data object and its schema.

Frequently Asked Questions about validating-json-data

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

FAQPage Schema
How do I validate JSON data against a schema in Node.js?

Validate JSON data against a schema in Node.js by creating a validator instance and calling the validate method with your data object and schema definition to catch structural and type errors.

What JSON Schema drafts are supported for validation?

JSON Schema validation supports drafts 04, 06, 07, 2019-09, and 2020-12, allowing you to enforce schema compliance across multiple specification versions.

Does JSON validation work in both sync and async modes?

JSON validation works in both sync and async modes, offering safe non-throwing options and optional schema pre-compilation to optimize performance during repetitive validation tasks.

How do I get detailed error paths when validating JSON?

Detailed JSON validation errors provide specific paths, error codes, and nested inner errors for complex schemas, producing actionable results to pinpoint exactly where data fails to conform.

Can I validate JSON schemas that use remote references?

Validating JSON schemas with remote references is supported, enabling data validation against distributed schema definitions that link to external structural resources.

What's the best way to validate API payloads against a schema?

Validate API payloads by pre-compiling schemas and using sync or async validation modes to enforce strict schema compliance, catching type and required field errors before processing.