MCPcopy
hub / github.com/authlib/authlib / ensure_dict

Function ensure_dict

authlib/jose/util.py:36–46  ·  view source on GitHub ↗
(s, structure_name)

Source from the content-addressed store, hash-verified

34
35
36def ensure_dict(s, structure_name):
37 if not isinstance(s, dict):
38 try:
39 s = json_loads(to_unicode(s))
40 except (ValueError, TypeError) as exc:
41 raise DecodeError(f"Invalid {structure_name}") from exc
42
43 if not isinstance(s, dict):
44 raise DecodeError(f"Invalid {structure_name}")
45
46 return s

Callers 3

deserialize_jsonMethod · 0.90
deserialize_jsonMethod · 0.90
parse_jsonMethod · 0.90

Calls 3

json_loadsFunction · 0.90
to_unicodeFunction · 0.90
DecodeErrorClass · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…