code: def get_serializer_class(self, view, method_func):
          
          if hasattr(method_func, 'request_serializer'):
              return getattr(method_func, 'request_serializer')
  
          if hasattr(view, 'serializer_class'):
              return getattr(view, 'serializer_class')
  
          if hasattr(view, 'get_serializer_class'):
              return getattr(view, 'get_serializer_class')()
  
          return None
docs: Try to get the serializer class from view method.
          If view method don't have request serializer, fallback to serializer_class on view class