Skip to main content

normalize_json

Recursively normalize an object into JSON-compatible types.

def normalize_json(
obj: Any
) - > Union[dict, list, str, int, float, bool, None]

Recursively normalize an object into JSON-compatible types.

Parameters

NameTypeDescription
objAnyThe input object to be converted, which can include mappings, sequences, bytes, or primitive types.

Returns

TypeDescription
Union[dict, list, str, int, float, bool, None]The normalized object containing only standard JSON-serializable types (dictionaries, lists, strings, numbers, booleans, or null).