def has_mapping(mapping, id_list, key):
    """
    Check if a vrt id has a mapping

    :param mapping: The mapping object, keyed by id
    :param id_list: The vrt id, split into components, eg ['category', 'subcategory', 'variant']
    :param key: The mapping key to look for, eg 'cvss_v3'
    :return: True/False
    """
    if key in mapping:
        return True
    elif 'children' in mapping:
        return has_mapping(mapping['children'], id_list, key)
    elif len(id_list) > 0 and id_list[0] in mapping:
        return has_mapping(mapping[id_list[0]], id_list[1:], key)
    else:
        return False