monkey/envs/monkey_zoo/blackbox/utils/json_encoder.py

10 lines
224 B
Python

import json
from bson import ObjectId
class MongoQueryJSONEncoder(json.JSONEncoder):
def default(self, o):
if isinstance(o, ObjectId):
return str(o)
return json.JSONEncoder.default(self, o)