You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a generic class MyParser[T] which parses a python object into a generic type Payload[T]. When specifying a concrete type (SubPayload in this case), the generic field fails to be parsed into a SubPayload.
I am aware Payload[SubPayload].model_validate works, but for my purposes, I would like the MyParser generic wrapper because in reality, it contains more logic.
Thanks for reporting this. Definitely doesn't seem like the right behavior. PRs welcome with a fix! Could be a great issue for someone looking to learn more about our internal generic processing.
Initial Checks
Description
I have a generic class
MyParser[T]
which parses a python object into a generic typePayload[T]
. When specifying a concrete type (SubPayload
in this case), the generic field fails to be parsed into aSubPayload
.I am aware
Payload[SubPayload].model_validate
works, but for my purposes, I would like theMyParser
generic wrapper because in reality, it contains more logic.Thank you.
Example Code
Python, Pydantic & OS Version
The text was updated successfully, but these errors were encountered: