Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.2k
Fix serialization schema generation when usingPlainValidator
#10427
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
Do not hardcode a new wrap serializer schema if a serializationschema was already generated before.
cloudflare-workers-and-pagesbot commentedSep 17, 2024 • 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: | 1fb016f |
Status: | ✅ Deploy successful! |
Preview URL: | https://956db31c.pydantic-docs.pages.dev |
Branch Preview URL: | https://10385.pydantic-docs.pages.dev |
codspeed-hqbot commentedSep 17, 2024 • 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#10427 willnot alter performanceComparing Summary
|
github-actionsbot commentedSep 17, 2024 • 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.
pydantic/functional_validators.py Outdated
core_schema.wrap_serializer_function_ser_schema( | ||
function=lambda v, h: h(v), | ||
schema=schema, | ||
return_schema=schema, |
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.
Do we not need to dohandler.generate_schema(source_type)
here?
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.
Hum I don't think it will change anything in this case asschema
is guaranteed to not have any serialization key here, but I'll change to align with how it is done inPlain/WrapSerializer
.
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.
Wonderful, thanks@Viicos!!
00b3762
intomainUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Do not hardcode a new wrap serializer schema if a serialization schema was already generated before.
Note that the following can be used as a failing MRE, related to the TODO comment:
Maybe we should create a new issue, and add a
xfail
test linking to this issue?Related issue number
Fixes#10385
Fixes#8586
Checklist