Skip to content

Json dumps

async_boto.utils.json_dumps

json_dump

json_dump(obj)

Custom method, which is used to handle types that cant be handled by json.dumps

Source code in async_boto/utils/json_dumps.py
 5
 6
 7
 8
 9
10
11
12
13
def json_dump(obj: Any):
    """
    Custom method, which is used to handle types that cant be handled by
    json.dumps
    """

    if isinstance(obj, datetime.datetime | datetime.date):
        return obj.isoformat()
    raise Exception(f"Type {type(obj)} not serializable")