Open notpushkin opened 2 years ago
There's already -O -. typeconv could take - as input, too. (It would probably imply writing to stdout as well, since filename can't be determined automatically)
-O -
-
We already can do this:
npx typeconv -f ts -t jsc -O - models.ts | datamodel-codegen > models.py
Why not the other way around?
# generate_jsonschema.py import json from pydantic.schema import schema from models import * print(json.dumps(schema([MyModel, ...]), indent=2))
python generate_jsonschema.py | npx typeconv -f jsc -t ts - > models.ts
There's already
-O -
. typeconv could take-
as input, too. (It would probably imply writing to stdout as well, since filename can't be determined automatically)Use case
We already can do this:
Why not the other way around?