ts-json-schema-generator
ts-json-schema-generator copied to clipboard
Generate JSON schema from your Typescript sources
Hi, while using your library, came across a case. I specify expose: 'none' in the settings to get the generator to not share types between types. But because of that,...
Today (v1.0.0) a union type like the following: ``` export type Fish = { animal_type: 'fish'; found_in: 'ocean' | 'river'; }; export type Bird = { animal_type: 'bird'; can_fly: boolean;...
Input: ```` type Expand = K extends string ? { id: K } : never; export type SimpleEduction = Expand; export type SimpleEduction2 = | {id: "boolean";} | {id: "custom";};...
When trying to generate schema for mapped type like this, I get just an empty object: ```typescript export interface Functional { fun(): string } export type FunctionalReturnTypes = { [Key...
As mentioned in #1152 , a schema [may be a plain boolean instead of an object](https://datatracker.ietf.org/doc/html/draft-handrews-json-schema-01#section-4.3.1), where `true` means "Always passes validation" and false means "Always fails validation". Currently, ts-json-schema-generator...
Hi, I have the following example which seems to return erroneous results: ```ts export type A = { readonly a1: string readonly a2: string } export type B1 = A...
I recently found out about JSON Type Definition, which is not extensive as JSON Schema in its goals, but definitely similar. I think a big part of it is targeting...
There are some instances where json-schema allows for certain expressiveness that cannot be represented in typescript. One such need I have is an object where **only one** of the following...
📦 Published PR as canary version: 0.96.1--canary.979.fe4869a.0 :sparkles: Test out this PR locally via: ```bash npm install [email protected] # or yarn add [email protected] ```
This ```ts type Schema = { a: { b: any } } & { a: { c: any } }; ``` yields this: ```json { "$schema": "http://json-schema.org/draft-07/schema#", "$ref": "#/definitions/Schema", "definitions":...