MCPcopy Index your code
hub / github.com/StackStorm/st2 / default

Method default

st2common/st2common/util/jsonify.py:48–54  ·  view source on GitHub ↗
(self, obj)

Source from the content-addressed store, hash-verified

46
47class GenericJSON(JSONEncoder):
48 def default(self, obj): # pylint: disable=method-hidden
49 if hasattr(obj, "__json__") and six.callable(obj.__json__):
50 return obj.__json__()
51 elif isinstance(obj, bson.ObjectId):
52 return str(obj)
53 else:
54 return JSONEncoder.default(self, obj)
55
56
57def default(obj):

Callers

nothing calls this directly

Calls 1

__json__Method · 0.45

Tested by

no test coverage detected