Test JSON Schema generation libraries capabilities.
The purpose of this repository is to show if different TypeScript to JSON Schema generating libraries can handle anything more complicated.
In src directory are the library sources to be generated. There are 2 types tests:
simple.tscontains very simple tests case without any external librariesindex.tsxcontains example React component with many different possible React types (from typescript-cheatsheets)
For each tested package, there is generator script in generators directory. To run it use:
yarn generate:<tested-package-name>The generator should generate types for Simple and ExampleProps types. Output will be stored in schemas directory if generation succeeded under following format:
<tested-package-name>-<type-name>.json
Install dependencies using yarn.
yarn| Library | Command | Simple |
ExampleProps |
|---|---|---|---|
| typescript-json-schema | yarn generate:typescript-json-schema |
✅ | ✅ |
| ts-json-schema-generator | yarn generate:ts-json-schema-generator |
✅ | ❌ |
| quicktype | yarn generate:quicktype |
✅ | ❌ |