pydantic-to-typescript
pydantic-to-typescript copied to clipboard
Handle Models where Config.extra is not set
Hi! First of all, many thanks for providing this useful tool!
I'm trying to get it running, but there are two issues I'm stuck with.
First is the same as #5
The second, when I pass the path of a python file directly I get:
`$pydantic2ts --module ./api/apps/folder/models.py --output test.ts --json2ts-cmd ./ui/node_modules/.bin/json2ts
2021-05-11 15:47:53,683 Finding pydantic models...
2021-05-11 15:47:53,688 Generating JSON schema from pydantic models...
Traceback (most recent call last):
File ".../venv/bin/pydantic2ts", line 8, in
AttributeError: type object 'Config' has no attribute 'extra' ` If I understand the docs correctly, the Config.extra field is optional. However, right now pydantic-to-typescript does not handle this case.