-
Notifications
You must be signed in to change notification settings - Fork 215
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
[BUG] Custom types like bson.Binary require __get_pydantic_core_schema__
#651
Comments
Hi! Thank you for the catch. I'll check it out in the next bug-fixing session this or next week |
The thing is Pydantic v2 needs some additional effort to support custom types. from beanie import BsonBinary
class Sample(Document):
binary_field: BsonBinary Please let me know if you have any issues with it. |
There is an issue with the |
This issue is stale because it has been open 30 days with no activity. |
@roman-right Any news regarding this? |
Should have been fixed by #739 |
Thanks, your PR solved this issue. |
Describe the bug
With pydantic 2.0 custom types like in my case
bson.Binary
cause issues. You either need to create a config witharbitrary_types_allowed = True
or implement__get_pydantic_core_schema__
This is the error:
To Reproduce
Expected behavior
It works without any issue
Additional context
Discord: https://ptb.discord.com/channels/822196934973456394/822196935435747332/1138966773044101190
The text was updated successfully, but these errors were encountered: