class _FieldSetValidatingSerializer(serializers.Serializer):

    def is_valid(self, raise_exception=False):
        super().is_valid(False)
fields_keys = set(self.fields.keys())
input_keys = set(self.initial_data.keys())
additional_fields = input_keys - fields_keys
if bool(additional_fields):
    self._errors['fields'] = ['Additional fields not allowed: {}.'.format(
        list(additional_fields))]
if self._errors and raise_exception:
    raise ValidationError(self.errors)
return not bool(self._errors)
Как заставить сериализатор rest_framework запрещать лишние поля?