def validate(self, attrs):
        conditions = attrs.get('conditions', [])
        errors = {}
        missing_conditions = set(self.required_conditions) - set([item.element_name for item in conditions])
        for element_name in missing_conditions:
            message = _('Required condition is missing')
            errors['conditions.' + element_name] = [message]
        for item in conditions:
            field_name = 'conditions.' + item.element_name
            if item.operator and item.operator != 'eq':
                message = _("starts-with and operators other than 'eq' are not allowed")
                errors[field_name] = errors.get(field_name, []) + [message]
            elif item.element_name not in self.required_conditions + self.optional_conditions:
                message = _('Invalid element name')
                errors[field_name] = errors.get(field_name, []) + [message]
        try:
            super(DefaultPolicySerializer, self).validate(attrs)
        except ValidationError as err:
            # Merge with our errors
            for field_name, error_messages in err.message_dict.items():
                errors[field_name] = errors.get(field_name, []) + list(error_messages)
        if len(errors):
            raise ValidationError(errors)
        else:
            return attrs
1. Disallow starts-with, which complicates validation, and
dataset/ETHPy150Open bodylabs/drf-to-s3/drf_to_s3/serializers.py/DefaultPolicySerializer.validate