MCPcopy Create free account
hub / github.com/getsentry/sentry / JSONCodec

Class JSONCodec

src/sentry/utils/codecs.py:68–77  ·  view source on GitHub ↗

Encode/decode Python data structures to/from JSON-encoded strings.

Source from the content-addressed store, hash-verified

66
67
68class JSONCodec(Codec[Any, str]):
69 """
70 Encode/decode Python data structures to/from JSON-encoded strings.
71 """
72
73 def encode(self, value: Any) -> str:
74 return str(json.dumps(value))
75
76 def decode(self, value: str) -> Any:
77 return json.loads(value)
78
79
80class ZlibCodec(Codec[bytes, bytes]):

Callers 5

__init__Method · 0.90
__init__Method · 0.90
test_codec_chainingFunction · 0.90
test_encoding_wrapperFunction · 0.90
test_redis_cache_compatFunction · 0.90

Calls

no outgoing calls

Tested by 3

test_codec_chainingFunction · 0.72
test_encoding_wrapperFunction · 0.72
test_redis_cache_compatFunction · 0.72