I want to modify response.json to a custom method
but I don’t want to modify the source code
for example:
class Json(json.JSONEncoder):
def default(self, o):
if isinstance(o, ObjectId):
return str(o)
return super().default(o)