Skip to content

pedromdev/ts-to-json-schema

Repository files navigation

TypeScript to JSON Schema

Unit Tests

Get JSON Schema from TypeScript types without Generators/CLIs

Documentation

Visit the official documentation for detailed information on how to use this library.

Prerequisites

TypeScript: 4.1 or newer

Magic's secret

While you use toJsonSchema function from @ts-to-json-schema/core to retrieve JSON schemas of your application types, the @ts-to-json-schema/transform package use TypeScript Compiler API to get information of these types, convert into JSON Schemas and adds them to toJsonSchema calls.

So you'll always need @ts-to-json-schema/core (as main dependency) and @ts-to-json-schema/transform (as dev dependency) packages.

Installation

npm install @ts-to-json-schema/core
npm install --save-dev typescript @ts-to-json-schema/transform ts-patch

Usage

Follow the instructions in the @ts-to-json-schema/core to know how to use the core function.

About

Generate JSON Schema from TypeScript types

Resources

License

Stars

Watchers

Forks

Packages

No packages published