Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.2k
Support strict specification on union member types#11481
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
… working to override config
cloudflare-workers-and-pagesbot commentedFeb 24, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Deploying pydantic-docs with |
Latest commit: | 620e0b6 |
Status: | ✅ Deploy successful! |
Preview URL: | https://573a8393.pydantic-docs.pages.dev |
Branch Preview URL: | https://fix-union-ser-strict.pydantic-docs.pages.dev |
inner_schema = {**cls._inner_schema, 'strict': strict} | ||
json_schema = core_schema.no_info_after_validator_function( | ||
source, # construct the type | ||
inner_schema, # pyright: ignore[reportArgumentType] | ||
) |
sydney-runkleFeb 24, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
This is kind of gross, but so is this whole custom core schema construct for secret types
codspeed-hqbot commentedFeb 24, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
CodSpeed Performance ReportMerging#11481 willnot alter performanceComparing Summary
|
c8acbec
intomainUh oh!
There was an error while loading.Please reload this page.
Paired withpydantic/pydantic-core#1638
Addresses the bug reported in#10571
In
pydantic
, we already don't allow users to apply thestrict
annotation to union types. This PR ensures that thestrict
specification on union members is respected (overrides config spec, if necessary).