A TypeScript interface parser for generating JSON schemas.
Install for CLI: yarn global add ischema-ts
| npm i ischema-ts -g
Run: ischema
for current directory, or ischema path/to/directory/
Mark interfaces for transpilation by wrapping them with: /* SCHEMA */
and /* END SCHEMA */
.
Example:
/* SCHEMA */
interface ITest {
[key: string]: any;
}
/* END SCHEMA */
Create an ischema.json
file in the root you will be running ischema in.
{
"options": {
"rootDir": ".",
"outDir": "./schemas"
}
}
Use ischema --init
or ischema --init path/to/folder
to create this file for you.
- Issues parsing function types properly.
- Does not conform types to JSON strict types (yet).