prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Add pagination to the `chains/` endpoint
  Add pagination support to `api/v1/chains`
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `src/chains/views.py`
  Content:
  ```
  1 from drf_yasg.utils import swagger_auto_schema
  2 from rest_framework.generics import ListAPIView
  3 
  4 from .models import Chain
  5 from .serializers import ChainSerializer
  6 
  7 
  8 class ChainsListView(ListAPIView):
  9     serializer_class = ChainSerializer
  10 
  11     @swagger_auto_schema()
  12     def get(self, request, *args, **kwargs):
  13         return super().get(self, request, *args, **kwargs)
  14 
  15     def get_queryset(self):
  16         return Chain.objects.all()
  17
  ```
  
  Path: `src/safe_apps/views.py`
  Content:
  ```
  1 from django.utils.decorators import method_decorator
  2 from django.views.decorators.cache import cache_page
  3 from drf_yasg import openapi
  4 from drf_yasg.utils import swagger_auto_schema
  5 from rest_framework.generics import ListAPIView
  6 
  7 from .models import SafeApp
  8 from .serializers import SafeAppsResponseSerializer
  9 
  10 
  11 class SafeAppsListView(ListAPIView):
  12     serializer_class = SafeAppsResponseSerializer
  13 
  14     _swagger_network_id_param = openapi.Parameter(
  15         "chainId",
  16         openapi.IN_QUERY,
  17         description="Used to filter Safe Apps that are available on `chainId`",
  18         type=openapi.TYPE_INTEGER,
  19     )
  20 
  21     @method_decorator(cache_page(60 * 10, cache="safe-apps"))  # Cache 10 minutes
  22     @swagger_auto_schema(manual_parameters=[_swagger_network_id_param])
  23     def get(self, request, *args, **kwargs):
  24         """
  25         Returns a collection of Safe Apps (across different chains).
  26         Each Safe App can optionally include the information about the `Provider`
  27         """
  28         return super().get(self, request, *args, **kwargs)
  29 
  30     def get_queryset(self):
  31         queryset = SafeApp.objects.all()
  32 
  33         network_id = self.request.query_params.get("chainId")
  34         if network_id is not None and network_id.isdigit():
  35             queryset = queryset.filter(chain_ids__contains=[network_id])
  36 
  37         return queryset
  38
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/src/chains/views.py b/src/chains/views.py
  --- a/src/chains/views.py
  +++ b/src/chains/views.py
  @@ -1,5 +1,6 @@
   from drf_yasg.utils import swagger_auto_schema
   from rest_framework.generics import ListAPIView
  +from rest_framework.pagination import LimitOffsetPagination
   
   from .models import Chain
   from .serializers import ChainSerializer
  @@ -7,6 +8,9 @@
   
   class ChainsListView(ListAPIView):
       serializer_class = ChainSerializer
  +    pagination_class = LimitOffsetPagination
  +    pagination_class.max_limit = 10
  +    pagination_class.default_limit = 10
   
       @swagger_auto_schema()
       def get(self, request, *args, **kwargs):
  diff --git a/src/safe_apps/views.py b/src/safe_apps/views.py
  --- a/src/safe_apps/views.py
  +++ b/src/safe_apps/views.py
  @@ -10,6 +10,7 @@
   
   class SafeAppsListView(ListAPIView):
       serializer_class = SafeAppsResponseSerializer
  +    pagination_class = None
   
       _swagger_network_id_param = openapi.Parameter(
           "chainId",
  
verification_info: {"golden_diff": "diff --git a/src/chains/views.py b/src/chains/views.py\n--- a/src/chains/views.py\n+++ b/src/chains/views.py\n@@ -1,5 +1,6 @@\n from drf_yasg.utils import swagger_auto_schema\n from rest_framework.generics import ListAPIView\n+from rest_framework.pagination import LimitOffsetPagination\n \n from .models import Chain\n from .serializers import ChainSerializer\n@@ -7,6 +8,9 @@\n \n class ChainsListView(ListAPIView):\n     serializer_class = ChainSerializer\n+    pagination_class = LimitOffsetPagination\n+    pagination_class.max_limit = 10\n+    pagination_class.default_limit = 10\n \n     @swagger_auto_schema()\n     def get(self, request, *args, **kwargs):\ndiff --git a/src/safe_apps/views.py b/src/safe_apps/views.py\n--- a/src/safe_apps/views.py\n+++ b/src/safe_apps/views.py\n@@ -10,6 +10,7 @@\n \n class SafeAppsListView(ListAPIView):\n     serializer_class = SafeAppsResponseSerializer\n+    pagination_class = None\n \n     _swagger_network_id_param = openapi.Parameter(\n         \"chainId\",\n", "issue": "Add pagination to the `chains/` endpoint\nAdd pagination support to `api/v1/chains`\n", "before_files": [{"content": "from drf_yasg.utils import swagger_auto_schema\nfrom rest_framework.generics import ListAPIView\n\nfrom .models import Chain\nfrom .serializers import ChainSerializer\n\n\nclass ChainsListView(ListAPIView):\n    serializer_class = ChainSerializer\n\n    @swagger_auto_schema()\n    def get(self, request, *args, **kwargs):\n        return super().get(self, request, *args, **kwargs)\n\n    def get_queryset(self):\n        return Chain.objects.all()\n", "path": "src/chains/views.py"}, {"content": "from django.utils.decorators import method_decorator\nfrom django.views.decorators.cache import cache_page\nfrom drf_yasg import openapi\nfrom drf_yasg.utils import swagger_auto_schema\nfrom rest_framework.generics import ListAPIView\n\nfrom .models import SafeApp\nfrom .serializers import SafeAppsResponseSerializer\n\n\nclass SafeAppsListView(ListAPIView):\n    serializer_class = SafeAppsResponseSerializer\n\n    _swagger_network_id_param = openapi.Parameter(\n        \"chainId\",\n        openapi.IN_QUERY,\n        description=\"Used to filter Safe Apps that are available on `chainId`\",\n        type=openapi.TYPE_INTEGER,\n    )\n\n    @method_decorator(cache_page(60 * 10, cache=\"safe-apps\"))  # Cache 10 minutes\n    @swagger_auto_schema(manual_parameters=[_swagger_network_id_param])\n    def get(self, request, *args, **kwargs):\n        \"\"\"\n        Returns a collection of Safe Apps (across different chains).\n        Each Safe App can optionally include the information about the `Provider`\n        \"\"\"\n        return super().get(self, request, *args, **kwargs)\n\n    def get_queryset(self):\n        queryset = SafeApp.objects.all()\n\n        network_id = self.request.query_params.get(\"chainId\")\n        if network_id is not None and network_id.isdigit():\n            queryset = queryset.filter(chain_ids__contains=[network_id])\n\n        return queryset\n", "path": "src/safe_apps/views.py"}], "after_files": [{"content": "from drf_yasg.utils import swagger_auto_schema\nfrom rest_framework.generics import ListAPIView\nfrom rest_framework.pagination import LimitOffsetPagination\n\nfrom .models import Chain\nfrom .serializers import ChainSerializer\n\n\nclass ChainsListView(ListAPIView):\n    serializer_class = ChainSerializer\n    pagination_class = LimitOffsetPagination\n    pagination_class.max_limit = 10\n    pagination_class.default_limit = 10\n\n    @swagger_auto_schema()\n    def get(self, request, *args, **kwargs):\n        return super().get(self, request, *args, **kwargs)\n\n    def get_queryset(self):\n        return Chain.objects.all()\n", "path": "src/chains/views.py"}, {"content": "from django.utils.decorators import method_decorator\nfrom django.views.decorators.cache import cache_page\nfrom drf_yasg import openapi\nfrom drf_yasg.utils import swagger_auto_schema\nfrom rest_framework.generics import ListAPIView\n\nfrom .models import SafeApp\nfrom .serializers import SafeAppsResponseSerializer\n\n\nclass SafeAppsListView(ListAPIView):\n    serializer_class = SafeAppsResponseSerializer\n    pagination_class = None\n\n    _swagger_network_id_param = openapi.Parameter(\n        \"chainId\",\n        openapi.IN_QUERY,\n        description=\"Used to filter Safe Apps that are available on `chainId`\",\n        type=openapi.TYPE_INTEGER,\n    )\n\n    @method_decorator(cache_page(60 * 10, cache=\"safe-apps\"))  # Cache 10 minutes\n    @swagger_auto_schema(manual_parameters=[_swagger_network_id_param])\n    def get(self, request, *args, **kwargs):\n        \"\"\"\n        Returns a collection of Safe Apps (across different chains).\n        Each Safe App can optionally include the information about the `Provider`\n        \"\"\"\n        return super().get(self, request, *args, **kwargs)\n\n    def get_queryset(self):\n        queryset = SafeApp.objects.all()\n\n        network_id = self.request.query_params.get(\"chainId\")\n        if network_id is not None and network_id.isdigit():\n            queryset = queryset.filter(chain_ids__contains=[network_id])\n\n        return queryset\n", "path": "src/safe_apps/views.py"}]}