marshmallow-mongoengine icon indicating copy to clipboard operation
marshmallow-mongoengine copied to clipboard

GenericReference._serialize() returns a bson.ObjectID instead of a str

Open beager opened this issue 7 years ago • 0 comments

GenericReference._serialize() returns a bson.ObjectID if it's not missing, where it should be cast to str, a la Reference._serialize(). This causes JSON serialization issues when attempting to work with GenericReferenceFields.

Applying the fix from #9 to GenericReference._serialize() would fix this issue. You may also consider having GenericReference as a subclass of Reference such that you'd get it for free.

Thanks for your consideration!

beager avatar Apr 25 '17 20:04 beager