  
          return [method for method in methods if method not in ('OPTIONS', 'HEAD')]
  
  
  class SchemaGenerator(object):
      # Map HTTP methods onto actions.
      default_mapping = {
          'get': 'retrieve',
          'post': 'create',
          'put': 'update',
 
</s> remove                 path = urlparse.urlparse(link.url).path
 </s> add                 path = parse.urlparse(link.url).path </s> remove         request = super(ViewSetMixin, self).initialize_request(request, *args, **kwargs)
 </s> add         request = super().initialize_request(request, *args, **kwargs) </s> remove             path = urlparse.urlparse(link.url).path
 </s> add             path = parse.urlparse(link.url).path </s> remove         return super(RelatedField, cls).__new__(cls, *args, **kwargs)
 </s> add         return super().__new__(cls, *args, **kwargs) </s> remove             six.text_type(key): key for key in self.choices
 </s> add             str(key): key for key in self.choices
class SchemaGenerator:
  
          return [method for method in methods if method not in ('OPTIONS', 'HEAD')]
  
  
class SchemaGenerator:
      # Map HTTP methods onto actions.
      default_mapping = {
          'get': 'retrieve',
          'post': 'create',
          'put': 'update',
keep keep keep keep replace keep keep keep keep keep
 Dropped Python 2 compatibility. (#6615)

Thanks to Jon Dufresne (@jdufresne) for review.

Co-authored-by: Asif Saif Uddin <auvipy@gmail.com>
Co-authored-by: Rizwan Mansuri <Rizwan@webbyfox.com> 
rest_framework/schemas/generators.py