json-schema

A lightweight, historical CommonJS implementation of the original JSON Schema draft specifications

Library
npm
v0.4.0
530 stars
Custom / Unknown

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
39 /100 Needs Attention
Development Activity 0
Maintenance 0
Community 76
Maturity 60
Momentum 20

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
43 /100 Fair
Architecture 45
Code Quality 40
Innovation 30
Learning Curve 55

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 checkPropertyChange helper for validating a single property change against a schema, respecting readonly
  • 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

TypeScript
72%
AGPL 3.0

APITable

Databases · Low Code Platforms

15,623

API-first collaborative spreadsheet-database platform that auto-generates REST APIs and lets teams build internal tools, CRMs, and dashboards without code.

View details
71
Repo Health
77
Technical
60
Dependency
Built with
TypeScript 72%
Java 22%
Updated 3 weeks ago
PHP
82%
Other

Akaunting

Invoicing Finance

10,149

Open-source online accounting for small businesses and freelancers — invoices, expenses, and reporting without monthly fees or vendor lock-in.

View details
98
Repo Health
73
Technical
63
Dependency
Built with
PHP 82%
Blade 13%
Updated 6 days ago
TypeScript
96%
Other

Amplication

AI Code Assistants · Automation · Developer Tools

16,015

Create production-ready backend services with your organization's standards baked in — generating NestJS, Prisma, and GraphQL code that you own and control.

View details
58
Repo Health
84
Technical
60
Dependency
Built with
TypeScript 96%
Updated 3 months ago
TypeScript
99%
AGPL 3.0

Cherry Studio

AI Assistants

52,202

All-in-one AI desktop client with 300+ assistants and multi-model support

View details
89
Repo Health
84
Technical
70
Dependency
Built with
TypeScript 99%
Updated 5 days ago
TypeScript
84%
Apache 2.0

Continue

AI Code Assistants · AI Development · Automation

36,049

Open-source coding agent for VS Code, JetBrains, and CLI with support for 30+ LLM providers.

View details
73
Repo Health
88
Technical
62
Dependency
Built with
TypeScript 84%
Updated 6 days ago
TypeScript
75%
Apache 2.0

Fern

Developer Tools

3,787

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.

View details
90
Repo Health
86
Technical
66
Dependency
Built with
TypeScript 75%
Updated 5 days ago
TypeScript
99%
Apache 2.0

Mastra Code

AI Code Assistants

28,378

"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.

View details
90
Repo Health
73
Technical
65
Dependency
Built with
TypeScript 99%
Updated 5 days ago
TypeScript
88%
MIT

medusa

Ecommerce

36,494

The most flexible open-source commerce platform — build B2C, B2B, and marketplace applications with modular, composable commerce primitives.

View details
93
Repo Health
87
Technical
63
Dependency
Built with
TypeScript 88%
JavaScript 12%
Updated 1 weeks ago
TypeScript
92%
Other

n8n

Automation · No Code Platforms

206,147

Code when you need it, UI when you don't — the workflow automation platform built for technical teams who refuse to choose.

View details
95
Repo Health
87
Technical
65
Dependency
Built with
TypeScript 92%
Updated 5 days ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers