David Montague

Results 226 comments of David Montague

From what I can tell, this is fixed on main and will be included in v2 now, but is called `pydantic.types.NewPath`. I think the equivalent of `PotentialFilePath = Union[FilePath, MissingPath]`,...

@samuelcolvin We've discussed this recently and I think were tentatively keeping the generated schema as `number`, but I @Kludex brought this issue to my attention (in the context of the...

I believe this has been resolved in v2: ```python from decimal import Decimal from pydantic import BaseModel class MyModel(BaseModel): foo: Decimal m = MyModel(foo="31231239131093781902381093810298310983123.12000000") print(m.model_dump()) #> {'foo': Decimal('31231239131093781902381093810298310983123.12000000')} print(m.model_dump_json()) #>...

@pinkfrog9 This issue seems to be more about serialization than deserialization, but I think in general you'd want to use `MyModel.model_validate(custom_json_deserialize(input_json))` to use a custom JSON deserializer, or `custom_json_serialize(MyModel.model_dump())` to...

This is fixed in v2, the only change is that we've eliminated `GenericModel` and you can make the `BaseModel` class generic directly: ```python from typing import Generic, TypeVar from typing_extensions...

This is resolved in v2; we no longer call `Model.__init__(**kwargs)` or anything like it using a `kwargs` coming from user input, so shouldn't have problems with TypeErrors coming from invalid...

For what it's worth, before 3.11, I think it should work almost equivalently to what `StrEnum` does in 3.11 if you just inherit from `str` before `Enum`: ``` class PetType(str,...

@michaeligreenberg this does look like a bug to me, but is not related to this issue (which was specific to problems caused by using literal enums; changing all the `Literal[Color.White]`...

The original reported issue is fixed in 1.10.7 and v2, so I will close this; please create a new issue for any other bugs discussed in this thread if they...

This seems to be fully resolved in v2, with the only caveat being that you need to set a default value of `None` for your first example to work: ```python...