@classmethod
def clean_data(cls, error, key=None, parent=None):
    """Clean empty errors."""
    if isinstance(error, dict):
        items = error.copy().items()
        for _key, _value in items:
            cls.clean_data(_value, _key, error)
    elif isinstance(error, list):
        aux = len(error)
        while aux > 0:
            aux -= 1
            cls.clean_data(error[aux], aux, error)
    if not error and parent:
        if isinstance(parent, dict):
            del parent[key]
        else:
            parent.pop(key)
