if 'metadata' in data:
        if isinstance(data['metadata'], dict):
            ret['metadata'] = data['metadata']
        else:
            log.warning('The metadata parameter must be a dictionary. Ignoring.')