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: serialize pydantic models #177

Merged
merged 2 commits into from
Jan 27, 2025
Merged

Conversation

skoob13
Copy link
Contributor

@skoob13 skoob13 commented Jan 27, 2025

Problem

Pydantic models are skipped by default. This behavior is annoying and unclear for customers.

Changes

Serialize Pydantic objects to dicts:

  • For v1, use the dict method.
  • For v2, use the model_dump method.

If something goes wrong during serialization, omit the key.

@skoob13 skoob13 requested review from Twixes and k11kirky January 27, 2025 14:01
Copy link
Member

@Twixes Twixes left a comment

Choose a reason for hiding this comment

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

Looking good

@Twixes Twixes merged commit eb07aaf into master Jan 27, 2025
2 checks passed
@Twixes Twixes deleted the fix/serialize-pydantic-objects branch January 27, 2025 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants