API views using the CustomCursorPagination have a with_count parameter that does not work
Found while working on #1116 (closed): The CustomCursorPagination
class is similar to the original DRF CursorPagination
class but includes an extra with_count=[true/false]
query parameter to optionally still add a count
property to the response. However, with_count
currently requires the arkindex.project.mixins.CursorPaginationViewMixin
to be used on the view class, and the requirement is undocumented. A view that uses CustomCursorPagination
without the mixin has with_count
available on OpenAPI, but it will have no effect.
ListProcessElements
is the only endpoint that correctly uses the mixin with the pagination class. ListCorpusWorkerVersions
uses the pagination class but without the mixin, causing with_count
to be present without actually working.
It is possible to rewrite the pagination class to avoid the mixin entirely, but it might be simpler to have it be in a separate class, where we only enable with_count
when it is seriously required, as the whole point of cursor pagination is to be performant. A count simply cannot be performant.