@@ -279,9 +279,9 @@ def get_link(self, path, method, generator):
279
279
280
280
fields = self .get_path_fields (path , method )
281
281
fields += self .get_serializer_fields (path , method )
282
+ fields += self .get_pagination_fields (path , method )
282
283
283
284
# TEMP: now we proxy back to the generator
284
- fields += generator .get_pagination_fields (path , method , view )
285
285
fields += generator .get_filter_fields (path , method , view )
286
286
287
287
if fields and any ([field .location in ('form' , 'body' ) for field in fields ]):
@@ -429,6 +429,19 @@ def get_serializer_fields(self, path, method):
429
429
430
430
return fields
431
431
432
+ def get_pagination_fields (self , path , method ):
433
+ view = self .view
434
+
435
+ if not is_list_view (path , method , view ):
436
+ return []
437
+
438
+ pagination = getattr (view , 'pagination_class' , None )
439
+ if not pagination :
440
+ return []
441
+
442
+ paginator = view .pagination_class ()
443
+ return paginator .get_schema_fields (view )
444
+
432
445
433
446
# TODO: Where should this live?
434
447
# - We import APIView here. So we can't import the descriptor into `views`
@@ -637,17 +650,6 @@ def get_encoding(self, path, method, view):
637
650
638
651
return None
639
652
640
- def get_pagination_fields (self , path , method , view ):
641
- if not is_list_view (path , method , view ):
642
- return []
643
-
644
- pagination = getattr (view , 'pagination_class' , None )
645
- if not pagination :
646
- return []
647
-
648
- paginator = view .pagination_class ()
649
- return paginator .get_schema_fields (view )
650
-
651
653
def get_filter_fields (self , path , method , view ):
652
654
if not is_list_view (path , method , view ):
653
655
return []
0 commit comments