Recursively convert a snake_cased dict into a camelCased dict

    :param snake_dict: Dictionary to convert
    :param convert_keys: Whether the key should be converted
    :param convert_subkeys: Whether to also convert the subkeys, in case they are named properties of the dict
    :return:

def dict_snake_to_camel_case(snake_dict, convert_keys=True, convert_subkeys=False):
    """
    Recursively convert a snake_cased dict into a camelCased dict

    :param snake_dict: Dictionary to convert
    :param convert_keys: Whether the key should be converted
    :param convert_subkeys: Whether to also convert the subkeys, in case they are named properties of the dict
    :return:
    """

    converted = {}
    for key, value in snake_dict.items():
        if isinstance(value, dict):
            new_value = dict_snake_to_camel_case(value, convert_keys=convert_subkeys,
                                                 convert_subkeys=True)
        elif isinstance(value, list):
            new_value = []
            for subvalue in value:
                new_subvalue = dict_snake_to_camel_case(subvalue, convert_keys=convert_subkeys,
                                                        convert_subkeys=True) \
                    if isinstance(subvalue, dict) else subvalue
                new_value.append(new_subvalue)
        else:
            new_value = value
        new_key = to_camel_case(key) if convert_keys else key
        converted[new_key] = new_value
    return converted