Skip to content

Add cursor-based pagination to route generation #29

Description

@PAMulligan

Description

The pipeline currently generates offset-based pagination. Add cursor-based pagination as an option, which is better suited for real-time data, infinite scroll, and large datasets.

Why

Offset pagination has well-known issues with large datasets (performance degrades as offset increases) and consistency issues (items shift between pages as new data is inserted). Cursor-based pagination solves both. The `pipeline.config.json` already has `cursorPaginationAvailable: true` but no implementation exists.

Current State

`pipeline.config.json`:
```json
"pagination": {
"defaultLimit": 20,
"maxLimit": 100,
"strategy": "offset",
"cursorPaginationAvailable": true
}
```

Acceptance Criteria

  • Implement cursor-based pagination in the `route-generation` skill
  • Support both opaque cursors (base64-encoded) and keyset pagination
  • Generate cursor pagination response format:
    ```json
    {
    "data": [...],
    "meta": {
    "hasNextPage": true,
    "hasPreviousPage": false,
    "startCursor": "abc123",
    "endCursor": "xyz789"
    }
    }
    ```
  • Allow per-endpoint selection of pagination strategy in `build-spec.json`
  • Add Zod schemas for cursor pagination query params (`?cursor=abc&limit=20`)
  • Generate integration tests for cursor pagination
  • Update the `api-documentation` skill to document cursor endpoints
  • CI passes

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions