pydantic-to-typescript
pydantic-to-typescript copied to clipboard
CLI Tool for converting pydantic models into typescript definitions
## What this PR does * Adds an option flag `--to-camel`, which triggers model property names to be converted from `snake_case` to `camelCase` in the resulting TS interfaces * Fixes...
The json-schema-to-typescript cli already offers a flag to configure the bannerComment, which I assumed would be used by this project. However specifying a custom bannerComment by doing something like `poetry...
Turns out, if the list of models is empty, a line export interface Master {} is generated **Yes**, I know this is an edge case, but having this simplifies the...
This fixes #28 by providing a `--readonly-interfaces` option that prevents non-optional fields with default values to become optional in the TypeScript interface. `--readonly-interfaces` can be read as "create interfaces for...
Example: ```py class MyModel(BaseModel): my_bool_property: bool = False ``` Convert to TypeScript and see output: ```ts interface MyModel { my_bool_property?: bool; } ``` I believe that the interface shouldn't define...
I created a fork with this merged so the community can easily install it via pip. The code is published to PyPI as pydantic-to-typescript2. Phillip Dupuis is still included as...
Hey there! I know that there hasn't been much activity here as of late so I hope this reaches someone. I'm working on a full stack project using Django as...
Currently if I have ``` class ChildClass(ParentClass): something: str class ParentClass(BaseModel): anything: str ``` The generated output is: ``` export interface ChildClass { something: string; anything: string; } export interface...
Hello, I have a nested package structure for all of my request/response types: API/ client/ types/ generic/ ... request/ ... response/ ... At first, I had absolute imports such as...