-
Notifications
You must be signed in to change notification settings - Fork 45
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
Added in a new object id field for mongodb #151
base: main
Are you sure you want to change the base?
Conversation
I think to solve this you might need to implement this method: @classmethod
def __get_pydantic_json_schema__(
cls, schema: core_schema.CoreSchema, handler: GetJsonSchemaHandler
) -> dict[str, Any]: ... similar to how it is implemented for other types |
Co-authored-by: Yasser Tahiri <yasserth19@gmail.com>
Co-authored-by: Alessio Castrica <64859146+Ale-Cas@users.noreply.github.com>
Also can you rename the new files to snake case (mongo_object_id.py and test_mongo_object_id.py) to follow the convention of other file names? |
Hi everyone -> this is for issue #133
I have been able to add a new pydantic object id field but I am facing some issues with serialisation and testing it
The field is validated correctly when used like
But I am facing some problem in doing
Something.model_json_schema(mode="serialization")
.Can someone look through my code and help me see what is wrong or what I need to change?