title: "Expected a list of items but got type \"dict\"."
body: <p>I am trying to build a api for updating first and last name for my user. I am getting the following error in HTTP Response</p>
  
  <pre><code>{
      "non_field_errors": [
          "Expected a list of items but got type \"dict\"."
      ]
  }
  </code></pre>
  
  <p>I have written the following API and trying to pass the patch request to it.</p>
  
  <pre><code>class UserSelfUpdateView(UpdateAPIView):
      serializer_class = UserUpdateSerializer
      permission_classes = [UserPermissions, ]
  
      def update(self, request: Request, *args, **kwargs):
          instance = User.objects.filter(id=self.request.user.id)
          serializer = UserUpdateSerializer(instance, data=request.data, many=True)
          serializer.is_valid(raise_exception=True)
          serializer.save()
  
          return Response({'success': True}, status=status.HTTP_200_OK)
  </code></pre>
  
  <p>The serializer for the above request is:</p>
  
  <pre><code>class UserUpdateSerializer(serializers.ModelSerializer):
  
      class Meta:
          model = User
          fields: ('id', 'first_name', 'last_name')
  </code></pre>
  
  <p>The format in which I am trying to pass my request body is:</p>
  
  <pre><code>{
      "first_name": "A",
      "last_name": "B"
  }
  </code></pre>
  
  <p>The reason for using </p>
  
  <blockquote>
    <p>instance = User.objects.filter(id=self.request.user.id)</p>
  </blockquote>
  
  <p>is because I want the functionality in a way that only logged in user is able to modify his details only.</p>