-
Notifications
You must be signed in to change notification settings - Fork 327
Open
Description
Describe the bug
When running typescript-json-schema on a TypeScript type alias that is set to never
, the tool throws an error:
TypeError: Unsupported type: never
at JsonSchemaGenerator.getDefinitionForRootType ...
To Reproduce
Steps to reproduce the behavior:
- Create a file with the following content:
export type Test = never;
- Run:
npx typescript-json-schema file.ts Test
Expected behavior
The tool should either:
- Generate a valid JSON schema for the
never
type (e.g., a schema that matches no values), or - Gracefully report that
never
is not supported, without throwing an unhandled exception. - When --ignoreErrors is passed, the tool should not crash and should continue processing.
Jan-Wilamowski-Clario, yokomotod and anirban09
Metadata
Metadata
Assignees
Labels
No labels