Document the cursor pagination on ListDatasetElements
Both ListProcessElements
and ListDatasetElements
use a custom cursor-based pagination that includes an optional with_count
boolean parameter, defaulting to False
. In the API response, count
is null unless with_count
is set to True
.
In ListDatasetElements
, the cursor
parameter is missing, and the default page
parameter is here instead, so the endpoint probably cannot be paginated using the API client. with_count
is also missing.
This is due to the way the paginator is built: since there is no pagination_class
attribute at all, DRF deduces the default pagination class should be used for the API schema instead of the modified cursor pagination. This does not affect ListProcessElements
since it uses pagination_class
directly. We'll need to update some parts of CustomCursorPagination
so that it does not take any arguments and instead uses the conventional method of customizing pagination through inheritance as DRF documents.
count
should also be documented as nullable in both endpoints. Some code already exists to try to do that, but it does not work. We could try to use a discriminator in the API response to document that count
is null or an integer depending on with_count
, on top of a help text.