ts-json-schema-generator
ts-json-schema-generator copied to clipboard
Generate JSON schema from your Typescript sources
Hello, Thanks for your work maintaining this tool. I noticed that projets has bunch of [tests](https://github.com/vega/ts-json-schema-generator/tree/next/test) and it would be nice to have a [Docusaurus documentation website](https://docusaurus.io/) showcasting input /...
I encounter errors with using discriminate unions in certain cases. I was able to reproduce a test case that throws `Type "Animal" has multiple definitions.` Interestingly, if I modify the...
Command: `npx ts-json-schema-generator --path '*.ts' --type Zoo` Input: ``` export interface Animal { name: string; } export interface Dog extends Animal { breed: string; } export interface Cat extends Animal...
In one of my types I have references to native interfaces that come with typescript, let's say: ```ts export type MyForm = { action: HTMLFormElement['action'], method: HTMLFormElement['method'], } ``` (Type...
Initially i though the type i wanted to import simply had a too complex module hierarchy and i'd be missing something. I wanted to use ` { RegisterOptions } from...
in JSON Schema Specification 7, it support `dependencies` in object type that can be used for data validate. reference: https://datatracker.ietf.org/doc/html/draft-handrews-json-schema-validation-01#page-14 draft 7: https://json-schema.org/specification-links.html#draft-7 --- more info: In JSON Schema 2019-09,...
I'm upgrading from 0.97.0 to 1.3.0 and now `ts-json-schema-generator` crashes. I have a `schema.ts` with exported types plus a helper function for validating the types using the generated schema. ```sh...
Property schema incorrectly referenced when there is a circular reference **Affected version: [ts-json-schema-generator](https://github.com/vega/ts-json-schema-generator)@1.3.0** **Types** ```ts export type Foo = { id: number; bars: Array; }; export type Broken = Pick;...
Take, for example, a collection of pets: ```ts type RedCat = { color: "red" }; type AshCat = { color: "ash" }; /** * @discriminator color */ type Cat =...
Constraints on object keys should be validated: ```ts /** * @minLength 2 * @maxLength 256 * @pattern ^\w+$ */ type ObjectKey = string; export type MyObject = { readonly [key:...