dataclass-wizard
dataclass-wizard copied to clipboard
Override Conversion for ObjectId when using asDict()
Description
I'm trying to serialize a custom class, in which an _id field is an ObjectId() instance for use in MongoDB
However, when I serialize it using asDict() it converts it to a string
How can I override this behavior recursively for any item of that class to skip conversion?
Hi @Bewinxed, thanks again for opening this issue. Can you provide a code example of how you are trying to de/serialize the custom class currently?
Although I do agree, supporting custom classes in the de/serialization process - i.e. that are not dataclasses, I feel is an important goal to have.