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

feat: add Pydantic BaseModel serialization support #1

Merged

Conversation

PondererOfEnigmas
Copy link

Add Pydantic BaseModel serialization support

Previously, ObjectModel fields containing BaseModel instances would trigger a "Object is not JSON serializable" error, when trying to use the save method.
This PR adds native support for serializing Pydantic BaseModel instances in _prepare_value function

Changes:

  • Add BaseModel type check
  • Use model_dump() for serialization
  • Maintain existing behavior for other types

@lfnovo lfnovo merged commit 078e39b into lfnovo:main Jan 17, 2025
4 checks passed
@lfnovo
Copy link
Owner

lfnovo commented Jan 17, 2025

Thanks for your contribution @PondererOfEnigmas .. merged.

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