← Back to Browse
Data Processing

SchemaGuard

Runtime JSON/YAML schema validation with automatic type coercion and descriptive error messages.

★★★★★ 4.5 234 reviews
8.9k installs
v3.0.2 MIT

Install

npx skilldock install schema-guard

About

SchemaGuard validates API request bodies, config files, and data payloads against JSON Schema definitions. It provides human-readable error messages, automatic type coercion (string "42" to number 42), default value injection, and Express middleware integration.

Usage Example

const { guard } = require("schema-guard");

app.post("/api/users", guard({
  body: {
    email: { type: "string", format: "email", required: true },
    age: { type: "integer", min: 13, coerce: true }
  }
}), handler);