json-schema-to-typescript
json-schema-to-typescript copied to clipboard
[BUG] Input coming from pipe not processed
cat schema.json | json2ts produces an empty file (just some comments)
json2ts schema.json works as expected.
I've experienced something similar. From looking at the source code, it seems in order for the Typescript type to be generated fully, it needs a value for the name parameter in compile(), which is undefined when using stdin. If my assessment is correct, then maybe cli.ts needs to support passing in a name which can use to then generate the full type or at least use a default (I see 'NoName' somewhere in there).
https://github.com/bcherny/json-schema-to-typescript/blob/8ea10a61f0d4b24749ae033a37f9aa3fb9a94417/src/index.ts#L112