TypeAdapter fails to validate against generic dataclass when using different type parameters #7430
Closed
1 task done
Labels
bug V2
Bug related to Pydantic V2
Initial Checks
Description
I've just started using pydantic, and I'm using
TypeAdapters
to turn JSON strings intodataclass
instances. This works really well until I try to validate the same generic class with a different type parameter. It seems to me that in my example, once you create aTypeAdapter
forOuter[int]
, you can only ever validate that exact type, and not types that use a different type parameter likeOuter[str]
.Example Code
Python, Pydantic & OS Version
The text was updated successfully, but these errors were encountered: