open-payments
open-payments copied to clipboard
Return 404 for empty list
or make startCursor
/endCursor
optional
https://github.com/interledger/open-payments/blob/f1b51c3c051c9030cea1f3d2542cfb492c4330d3/openapi/resource-server.yaml#L1242-L1270
Open Payments list endpoints currently return
local-peer-backend-1 | {
local-peer-backend-1 | status: 200,
local-peer-backend-1 | message: 'OK',
local-peer-backend-1 | header: [Object: null prototype] {
local-peer-backend-1 | 'content-type': 'application/json; charset=utf-8'
local-peer-backend-1 | },
local-peer-backend-1 | body: {
local-peer-backend-1 | pagination: { hasPreviousPage: false, hasNextPage: false },
local-peer-backend-1 | result: []
local-peer-backend-1 | }
local-peer-backend-1 | }
which causes
local-peer-backend-1 | InternalServerError: response.pagination must have required property 'startCursor'
local-peer-backend-1 | at Object.throw (/workspace/node_modules/.pnpm/[email protected]/node_modules/koa/lib/context.js:97:11)
local-peer-backend-1 | at /workspace/packages/openapi/dist/middleware.js:32:26
local-peer-backend-1 | at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
local-peer-backend-1 | at async /workspace/packages/backend/dist/open_payments/payment_pointer/middleware.js:16:9
local-peer-backend-1 | at async bodyParser (/workspace/node_modules/.pnpm/[email protected]/node_modules/koa-bodyparser/index.js:95:5)
I think we should make the startCursor
/endCursor
optional
startCursor
& endCursor
already optional