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

Fix Secret serialization schema, applicable for unions #9240

Merged
merged 2 commits into from Apr 16, 2024

Conversation

sydney-runkle
Copy link
Member

@sydney-runkle sydney-runkle commented Apr 14, 2024

Fix #9231

Selected Reviewer: @hramezani

@sydney-runkle
Copy link
Member Author

Please review

Copy link

cloudflare-pages bot commented Apr 14, 2024

Deploying pydantic-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 6673dc5
Status: ✅  Deploy successful!
Preview URL: https://8d35bcec.pydantic-docs2.pages.dev
Branch Preview URL: https://fix-secret-ser.pydantic-docs2.pages.dev

View logs

Copy link

codspeed-hq bot commented Apr 14, 2024

CodSpeed Performance Report

Merging #9240 will not alter performance

Comparing fix-secret-ser (6673dc5) with main (6aab43e)

Summary

✅ 13 untouched benchmarks

Copy link
Contributor

@davidhewitt davidhewitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix here seems a bit magical to me, can you give a bit more detail on why the original schema was wrong? I wonder if there's a deeper bug or otherwise awkward behaviour...

@sydney-runkle
Copy link
Member Author

@davidhewitt,

I think there's a deeper bug, that the serialization attached to the individual python and json schemas wasn't working - definitely something that we could fix + use to clean up some schemas or at least make them a bit more intuitive.

Will report this in core.

@sydney-runkle
Copy link
Member Author

Opened an issue here to address that bug in core, but this should work for now. Here's that issue: pydantic/pydantic-core#1270

@sydney-runkle sydney-runkle merged commit ae71183 into main Apr 16, 2024
54 checks passed
@sydney-runkle sydney-runkle deleted the fix-secret-ser branch April 16, 2024 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

JSON serialisation error with Secret types union.
3 participants