typescript-json-schema is a code generation tool that produces JSON Schema definitions from TypeScript type definitions.
The tool solves the problem of keeping JSON Schema documentation synchronized with TypeScript types by parsing TypeScript source code and extracting complete type information through the TypeScript compiler. It translates TypeScript language features—required properties, type extensions, JSDoc annotations, and property initializers—into their JSON Schema equivalents. The generator works both as a command-line utility and as a programmatic API, accepting either a tsconfig.json file or direct TypeScript file globs as input.
The tool suits projects that need JSON Schema validation or documentation derived from existing TypeScript definitions, particularly those already using TypeScript for type safety. It handles annotation-driven customization through JSDoc comments, allowing developers to override inferred types for array items and specify additional schema properties. The README acknowledges that for more comprehensive JSON Schema generation capabilities, ts-json-schema-generator offers a more complete feature set, positioning this tool as a lightweight alternative.
The project is in maintenance mode rather than active development. The codebase shows selective engagement with issues and pull requests rather than continuous feature expansion. The tool maintains backward compatibility with its existing API surface while accepting targeted improvements that do not require architectural changes.