api_helper.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:moesifapi-python 作者: Moesif 项目源码 文件源码
def json_deserialize(json, unboxing_function=None):
        """JSON Deerialization of a given string.

        Args:
            json (str): The JSON serialized string to deserialize.

        Returns:
            dict: A dictionary representing the data contained in the
                JSON serialized string.

        """
        if json is None:
            return None

        try:
            decoded = jsonpickle.decode(json)
        except:
            return json

        if unboxing_function == None:
            return decoded
        elif type(decoded) == list:
            return [unboxing_function(element) for element in decoded]
        else:
            return unboxing_function(decoded)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号