bcherny/json-schema-to-typescript

Compile JSON Schema to TypeScript type declarations

View on GitHub ↗Jump to charts ↓Open shareable report

Summary Information

Updated 1 hour ago
Added to GitGenius on September 20th, 2026
Created on March 22nd, 2016
Open Issues & Pull Requests: 139 (+0)
GitHub issues: Enabled
Number of forks: 464
Total Stargazers: 3,348 (+0)
Total Subscribers: 17 (+0)

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 76
New in 7 days: 0
Closed in 7 days: 0
Avg open age: 2,187 days
Stale 30+ days: 72
Stale 90+ days: 0

Recent activity

Opened in 7 days: 0
Closed in 7 days: 0
Comments in 7 days: 0
Events in 7 days: 0

Top labels

  • auto-repro-checked (164)
  • help wanted (69)
  • auto-repro-confirmed (57)
  • enhancement (57)
  • good first issue (46)
  • bug (41)
  • in discussion (34)
  • auto-repro-fixed (20)

Most active issues this week

No issue events were indexed in the last 7 days.

Detailed Description

json-schema-to-typescript is a code generator that compiles JSON Schema definitions into TypeScript type declarations.

The tool solves the problem of keeping TypeScript types synchronized with JSON Schema specifications. Rather than manually writing type definitions that match a schema, developers provide a JSON Schema file and the tool generates corresponding TypeScript interfaces and types. The generator handles complex schema features including nested objects, arrays, unions, enums, and schema references, producing valid TypeScript declaration files that can be used immediately in projects.

The tool suits projects that rely on JSON Schema as a source of truth for data validation or API contracts. It works well for teams using schemas to document APIs, configuration formats, or data structures that need corresponding TypeScript types. The CLI provides straightforward conversion of individual schema files, while the programmatic API allows integration into build pipelines. An experimental `--imports` mode enables compiling multiple related schemas together, automatically converting cross-file references into TypeScript imports rather than duplicating type definitions across output files. This is particularly useful when schemas reference shared definitions in a common file.

The project maintains active development with regular updates to handle new Node.js versions and TypeScript features. The codebase receives ongoing refinement of edge cases in schema compilation, particularly around how references and cycles are resolved. The tool includes a browser-based demo for trying conversions interactively before adopting it in a workflow.