Skip to content

Fix Secret serialization schema, applicable for unions#9240

Merged
sydney-runkle merged 2 commits intomainfrom
fix-secret-ser
Apr 16, 2024
Merged

Fix Secret serialization schema, applicable for unions#9240
sydney-runkle merged 2 commits intomainfrom
fix-secret-ser

Conversation

@sydney-runkle
Copy link
Copy Markdown
Contributor

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

Fix #9231

Selected Reviewer: @hramezani

@sydney-runkle
Copy link
Copy Markdown
Contributor Author

Please review

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-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

@codspeed-hq
Copy link
Copy Markdown

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
Copy Markdown
Collaborator

@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
Copy Markdown
Contributor 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
Copy Markdown
Contributor 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

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