Package Exports
- typescript-to-json-schema
- typescript-to-json-schema/dist
- typescript-to-json-schema/dist/factory/formatter
- typescript-to-json-schema/dist/factory/parser
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (typescript-to-json-schema) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
typescript-to-json-schema
Inspired by YousefED/typescript-json-schema. Here's the differences list:
- this implementation does not use
typeChecker.getTypeAtLocation()(so probably it keeps correct type aliases) - the following features are not supported yet:
- JSDoc annotations (planned)
- command line options (planned)
Array<Type>notation (planned)T & Utype intersection (planned)classtypes (not planned)typeoftypes (not planned)
- processing AST and formatting JSON schema have been split into two independent steps
- not exported types, interfaces, enums are not exposed in the
definitionssection in the JSON schema
Usage
npm install typescript-to-json-schema
./node_modules/.bin/typescript-to-json-schema \
--path 'my/project/**.*.ts' \
--type 'My.Type.Full.Name'Current state
interfacetypesenumtypesunion,tuple,type[]typesstring,boolean,numbertypes"value",123,true,false,nullliterals- type aliases
- generics