Problem Statement
Collection endpoints without pagination parameters risk server timeout crashes when returning large datasets.
❌ Anti-Pattern / Bad Implementation
Collection endpoint returning array without limit/offset or cursor parameters.
bad-pattern.yaml
paths:
/v1/orders:
get:
responses:
'200':
description: List of orders✓ Refactored / Recommended Implementation
Cursor-based pagination with limit and starting_after parameters.
good-pattern.yaml
paths:
/v1/orders:
get:
summary: List orders with cursor pagination
parameters:
- name: limit
in: query
schema:
type: integer
default: 20
- name: starting_after
in: query
schema:
type: string
responses:
'200':
description: Paginated orders payload
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/Order'
has_more:
type: booleanHow APIForge Checks This
- Analyzes collection endpoint parameters
- Verifies response wrapper schemas
