How do I convert a MappedClass object to JSON
?
json.dumps({"data": mappedClassObject}, indent=True)
Above code raises error that MappedClass object is not JSON serializable.
Is there any utility similar to BSON's json_util to convert MappedClass to JSON? or Do I have to write a encoder as mentioned in TypeError: ObjectId('') is not JSON serializable
Am using python 2.7
As of now, I have created a encoder for my use. This is hacky and if there is a better alternate, I will consider it.