Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make walk_core_schema public #9320

Closed
2 of 13 tasks
rmorshea opened this issue Apr 25, 2024 · 1 comment
Closed
2 of 13 tasks

Make walk_core_schema public #9320

rmorshea opened this issue Apr 25, 2024 · 1 comment

Comments

@rmorshea
Copy link

rmorshea commented Apr 25, 2024

Initial Checks

  • 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.

Affected Components

@sydney-runkle
Copy link
Member

Hi @rmorshea,

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.

Glad you've been finding it helpful though!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants