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 searched Google & GitHub for similar requests and couldn't find anything
I have read and followed the docs and still think this feature is missing
Description
Currently pydantic._internal._core_utils.walk_core_schema is private, but it has enough utility that it ought to be made public. I've found it extremely useful modifying Pydantic schemas in order to suite my needs. In particular #8279 (comment), where I've managed to work around the issue described in that discussion by walking the schema and wrapping is-instance schemas in a json-or-python schema that implements custom validation/serialization logic for a set of known third party types.
The relatively stable nature of Pydantic V2's schemas means it would be possible for someone to implement their own version of this function (that's actually what I did before I discovered walk_core_schema) but it would be great to rely on one maintained in Pydantic.
Thanks for your feature request. The walk_core_schema logic is most definitely still under development, in terms of both performance improvements and logic modifications. I don't think it's likely that we'll make this a public utility anytime soon given the quite frequent changes that we currently make to it, and I think we want to reserve the right of privacy in order to guarantee the faster development cycles.
Initial Checks
Description
Currently
pydantic._internal._core_utils.walk_core_schema
is private, but it has enough utility that it ought to be made public. I've found it extremely useful modifying Pydantic schemas in order to suite my needs. In particular #8279 (comment), where I've managed to work around the issue described in that discussion by walking the schema and wrappingis-instance
schemas in ajson-or-python
schema that implements custom validation/serialization logic for a set of known third party types.The relatively stable nature of Pydantic V2's schemas means it would be possible for someone to implement their own version of this function (that's actually what I did before I discovered
walk_core_schema
) but it would be great to rely on one maintained in Pydantic.Affected Components
.model_dump()
and.model_dump_json()
model_construct()
, pickling, private attributes, ORM modeThe text was updated successfully, but these errors were encountered: