Skip to content

PaginationHandler needs some work #46

Description

@tlater-famedly

The current implementation lifts a lot of state out of existing objects into the trait; we could instead probably simply assume that paginated requests are in fact V1|V2ListRequests, and use the state from their inner query attribute. This would significantly reduce code duplication for every paginated search endpoint. Even if not all paginated requests are search requests with query attributes, we could create a separate trait for these search requests.

We also currently hand-rewrite the types to use usize (since we count pages and usize presumably felt more appropriate), however the spec specifies i64. We should change those back (maybe regenerate the types and build impls on wrapper structs like this one, or simply implement the trait sketched out above on them).

Finally, we are currently hand-cloning structs when they implement Clone - we really ought to stop doing that.

In general, the PaginationHandler should probably be thought out once more; these are just things I realized while working with it in #45 - see comments there for specific pointers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Technical DebtThis Issue is a technical debt. Mark issues with this label to have an overview of the code quality.

    Type

    Fields

    No fields configured for Task.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions