title: Serializer not working in custom method in model viewset,
body: <p>This is my custom method in model viewset.</p>
  <pre class="lang-py prettyprint-override"><code>class UserViewSet(viewsets.ModelViewSet):
      @action(detail=False, methods=['POST'],serializer_class=UserSerializer, name='Attach meta items ids')
      def create_user(self, request):
         queryset = User.objects.all() 
         serializer = self.get_serializer(data=request.data)
         serializer.is_valid(raise_exception=True)
         return Response(serializer.data)
  
  </code></pre>
  <p>this is my serialzer</p>
  <pre class="lang-py prettyprint-override"><code>
  class UserSerializer(serializers.ModelSerializer):
  
      password = serializers.CharField(write_only=True)
      print(&quot;lklml&quot;)
      def create(self, validated_data):
          print(&quot;hjniknjbj&quot;)
          if UserModel.objects.filter(email=validated_data['email']).exists():
              raise serializers.ValidationError(&quot;A user is already registered with this e-mail address.&quot;)
  
          if UserModel.objects.filter(
                  username=validated_data['username']).exists():
              raise serializers.ValidationError(&quot;This username already exists.&quot;)
          user = UserModel.objects.create(
              username=validated_data['username'],
              email=validated_data['email']
          )
          # add custom password password validation later
          user.set_password(validated_data['password'])
          user.save()
  
          return user
  
      class Meta:
          model = UserModel
          fields = (&quot;id&quot;, &quot;username&quot;, &quot;password&quot;, &quot;email&quot;,)
          extra_kwargs = {&quot;password&quot;: {'write_only': True}}
  
  </code></pre>
  <p>Now when ever i hit the api it's directly returning data what i sent and not going through serializer process i.e: returning same thing which i am posting.The issue is only when i am using custom viewset method.</p>
  <pre><code>{&quot;username&quot;:&quot;pragghgjhhhkhhhhjbjhjhkjbjvin&quot;,&quot;email&quot;:&quot;pravwnkwin@dat.com&quot;,&quot;password&quot;:&quot;kms@1234&quot;}
  </code></pre>