ts-json-schema-generator
ts-json-schema-generator copied to clipboard
Generate JSON schema from your Typescript sources
When trying to use this tool in a monorepo, I'm getting 'module not found' errors for some of my cross-module imports that rely on the paths setting in tsconfig. This...
## Description When attempting to generate a JSON schema for a TypeScript type that uses indexed access references from another file, `ts-json-schema-generator` does not produce the expected output. Instead, it...
Hi, I have a use case where I'm referencing types from another services libraries. However multiple services may define the same name so they would conflict. So, my objective is...
Encountered with this repro: ```sh npx ts-json-schema-generator --path 'schema.ts' --type 'Schema' /workspaces/my-app/node_modules/ts-json-schema-generator/dist/ts-json-schema-generator.js:99 throw error; ^ TypeError: Cannot read properties of undefined (reading 'getId') at /workspaces/my-app/node_modules/ts-json-schema-generator/dist/src/Utils/nodeKey.js:43:57 at Array.map () at getKey...
ts-json-schema-generator appears to be bugged when generating schemas for classes. For example: ```ts export class Foo { /** Whether or not foo has a bar. */ someAttribute: boolean; } ```...
For some reason generation is failing for the following: ```js type AtLeastOne = Partial & U[keyof U]; interface SomeInterface { props: AtLeastOne; } ``` with the following error: ``` Uncaught...
# Typescript-restricted key (fail) ``` // test_str.ts export type A = `wifi${number}`; ``` ``` // actual_str.json { "$ref": "#/definitions/A", "$schema": "http://json-schema.org/draft-07/schema#", "definitions": { "A": { "type": "string" } } }...
For example: ```json { "$schema": "http://json-schema.org/draft-07/schema", "title": "Contact",
This is the error: ``` [email protected]/node_modules/ts-json-schema-generator/src/ChainNodeParser.ts:50 throw new UnknownNodeError(node, context.getReference()); ^ UnknownNodeError: Unknown node " import("@octokit/types").RequestInterface" of kind "LastTypeNode" at ChainNodeParser.getNodeParser (node_modules/.pnpm/[email protected]/node_modules/ts-json-schema-generator/src/ChainNodeParser.ts:50:15) at ChainNodeParser.createType (node_modules/.pnpm/[email protected]/node_modules/ts-json-schema-generator/src/ChainNodeParser.ts:35:25) at TypeofNodeParser.createType (node_modules/.pnpm/[email protected]/node_modules/ts-json-schema-generator/src/NodeParser/TypeofNodeParser.ts:38:45) at ChainNodeParser.createType...
I'm testing the waters here; not sure how you feel about this. I could maintain a fork of course, but I'd prefer not to ... This PR adds support for...