  from django.test import TestCase, override_settings
  
  from rest_framework import filters, pagination, permissions, serializers
  from rest_framework.compat import coreapi
  from rest_framework.decorators import detail_route
  from rest_framework.response import Response
  from rest_framework.routers import DefaultRouter
  from rest_framework.schemas import SchemaGenerator
  from rest_framework.test import APIClient
  from rest_framework.views import APIView
 
</s> remove             links.append((key, link))
 </s> add             links.append((category, action, link)) </s> remove         if not link:
 </s> add         if not links: </s> remove         # Generate the schema content structure, from the endpoints.
        # ('users', 'list'), Link -> {'users': {'list': Link()}}
 </s> add         # Generate the schema content structure, eg:
        # {'users': {'list': Link()}} </s> remove         for key, link in links:
            insert_into(content, key, link)
 </s> add         for category, action, link in links:
            if category is None:
                content[action] = link
            elif category in content:
                content[category][action] = link
            else:
                content[category] = {action: link}
from rest_framework.decorators import detail_route, list_route
  from django.test import TestCase, override_settings
  
  from rest_framework import filters, pagination, permissions, serializers
  from rest_framework.compat import coreapi
from rest_framework.decorators import detail_route, list_route
  from rest_framework.response import Response
  from rest_framework.routers import DefaultRouter
  from rest_framework.schemas import SchemaGenerator
  from rest_framework.test import APIClient
  from rest_framework.views import APIView
keep keep keep keep replace keep keep keep keep keep
 Fix schema categories for custom list actions (#4386) 
tests/test_schemas.py