-
Notifications
You must be signed in to change notification settings - Fork 37
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
DeserializationError when loading into a class with an Optional bson.ObjectID #176
Comments
Hi @yurirocha15 , You are trying to load a "half json-serialized" object; a I traced down what happened. In non-strict mode, when an object is loaded into a class of which it already is an instance (e.g. Do you really need to load a "half json-serialized" object, or would it be possible in your case to just do the following? TestData(**data2) |
This would be possible in the example I posted but not in my real use case. I am parsing a nested dictionary into nested dataclasses; this optional parameter is in the deeper layers of the dictionary. Therefore, using the root dataclass constructor directly is not an option for me. Is there any way to solve this using custom serializers/deserializers? |
Hello, I encountered an issue when loading data into a class with an Optional ObjectID field.
Environment
Python 3.8.5
jsons 1.6.3
Issue
Reproducing the Error
Here is an example script where this error is happening:
The text was updated successfully, but these errors were encountered: