Closed
Description
Copied over from phillipdupuis#28:
Example:
class MyModel(BaseModel): my_bool_property: bool = FalseConvert to TypeScript and see output:
interface MyModel { my_bool_property?: bool; }I believe that the interface shouldn't define the property as optional, since Pydantic will ensure it is hydrated with the default value of false if it's not provided when creating models, e.g.:
newModel = MyModel() assert newModel.my_bool_property is False # assertion passesExpected TypeScript interface:
interface MyModel { my_bool_property: bool; }
Metadata
Metadata
Assignees
Labels
No labels