Skip to content

Fix serialization of mongo_object_id #302

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

Merged
merged 2 commits into from
Mar 24, 2025
Merged

Conversation

MaximilianClemens
Copy link
Contributor

Fixes #300.
Serialization on model_dump = ObjectId
Serialization on model_dump_json = str

@MaximilianClemens MaximilianClemens changed the title Update mongo_object_id.py Fix serialization of mongo_object_id Mar 24, 2025
Copy link
Collaborator

@yezz123 yezz123 left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@yezz123 yezz123 merged commit 78ac0a3 into pydantic:main Mar 24, 2025
10 checks passed
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.

MongoObjectId: model_dump returns string instead of ObjectId
2 participants