json-schema
A lightweight, historical CommonJS implementation of the original JSON Schema draft specifications
Repository Health
Technical Analysis
json-schema is the original CommonJS implementation of the early JSON Schema draft specifications (draft-00 through draft-04), maintained by Kris Zyp as a stable, frozen reference implementation. Despite being intentionally unmaintained beyond bug-level stability, it remains one of the most heavily depended-upon packages in the npm ecosystem because dozens of tools built on the original JSON Schema drafts still require its validation primitives to remain byte-for-byte consistent over time.
The package exposes a single validate function that checks a JavaScript object instance against a schema object, returning a simple list of {property, message} validation errors. It intentionally does not chase the latest JSON Schema specification versions — that work has moved to the json-schema-org organization — making this package a deliberately “finished” artifact valued for stability rather than active feature development.
What You Get
- A single
validate(instance, schema)function returning{valid, errors}for straightforward object validation - A
checkPropertyChangehelper for validating a single property change against a schema, respectingreadonly - Support for the original draft JSON Schema keywords (type, properties, required, format, etc.)
- The historical draft specification text files (draft-00 through draft-04) bundled directly in the repository
- Zero runtime dependencies, keeping the module tiny and safe to embed transitively
Common Use Cases
- Validating configuration objects or API payloads against legacy JSON Schema draft definitions
- Acting as the underlying validation engine for older tools and frameworks that standardized on this implementation years ago
- Studying or referencing the original JSON Schema draft specification text alongside a working implementation
- Maintaining backward compatibility in long-lived codebases that cannot migrate to newer schema validators without a rewrite
Under The Hood
Architecture - The entire implementation lives in lib/validate.js (~270 lines), a single UMD-wrapped module that exports a validate(instance, schema, options) function plus checkPropertyChange. Validation walks the schema recursively, checking type, properties, required, additionalProperties, format, and related keywords, accumulating {property, message} error objects into a flat list rather than throwing. A companion lib/links.js implements JSON Schema “links” (hyperschema) resolution separately from the core validator, keeping the two concerns decoupled.
Tech Stack - Pure vanilla JavaScript with zero runtime dependencies, written to run equally in Node.js (CommonJS), AMD environments, and directly as a browser global via a UMD wrapper at the top of validate.js. The only devDependency is vows, a now-legacy BDD test framework, reflecting the project’s original-era tooling choices.
Code Quality - Tests exist under test/tests.js and run via vows --spec test/*.js, covering the core validation keywords against the bundled draft schemas. Code style is dense and comment-driven rather than typed or heavily abstracted — there are no TypeScript types, no linter configuration, and error handling is done purely through the returned errors array rather than exceptions, which is idiomatic for the era the library was written in but dated by modern standards.
API Design - The API surface is intentionally minimal: one function to validate, one to check a property change. This makes it trivial to embed but also inflexible — there’s no plugin system, no custom keyword registration, and no async validation support, which is why newer validators (Ajv, Zod) have superseded it for greenfield use even as this package remains load-bearing for legacy dependents.
Used by 15 apps in this directory
APITable
Low Code Platforms · Databases
API-first collaborative spreadsheet-database platform that auto-generates REST APIs and lets teams build internal tools, CRMs, and dashboards without code.
Akaunting
Invoicing Finance
Open-source online accounting for small businesses and freelancers — invoices, expenses, and reporting without monthly fees or vendor lock-in.
Amplication
Developer Tools · AI Code Assistants · Automation
Create production-ready backend services with your organization's standards baked in — generating NestJS, Prisma, and GraphQL code that you own and control.
Cherry Studio
AI Assistants
All-in-one AI desktop client with 300+ assistants and multi-model support
Continue
Developer Tools · AI Development · AI Code Assistants
Open-source coding agent for VS Code, JetBrains, and CLI with support for 30+ LLM providers.
Fern
Developer Tools
Fern turns a single OpenAPI, AsyncAPI, or Protobuf definition into type-safe SDKs for nine languages and a hosted API documentation site, all from one CLI and one source of truth.
Mastra Code
AI Code Assistants
"A coding agent that never compacts" — a terminal-based AI coding agent built on the Mastra framework, with Observational Memory instead of context compaction, multi-model support, and OAuth login for Claude Max or ChatGPT Plus.
medusa
Ecommerce
The most flexible open-source commerce platform — build B2C, B2B, and marketplace applications with modular, composable commerce primitives.
n8n
Automation · No Code Platforms
Code when you need it, UI when you don't — the workflow automation platform built for technical teams who refuse to choose.