Skip to content

fix: align OpenAPI events limit max with code constant (500 -> 200)#942

Open
CHKM001 wants to merge 1 commit into
LabsCrypt:mainfrom
CHKM001:fix/events-limit-max-200
Open

fix: align OpenAPI events limit max with code constant (500 -> 200)#942
CHKM001 wants to merge 1 commit into
LabsCrypt:mainfrom
CHKM001:fix/events-limit-max-200

Conversation

@CHKM001

@CHKM001 CHKM001 commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

PR #814 Fix OpenAPI events limit max mismatch (500 → 200)

Problem

GET /v1/streams/{streamId}/events documented limit parameter with maximum: 500 in stream.routes.ts:94, but the runtime code in events.routes.ts:24 defines MAX_EVENTS_PAGE_SIZE = 200 and the controller clamps to that value. A client requesting limit=400 would silently receive at most 200 rows, contradicting the published contract.

Change

  • backend/src/routes/v1/stream.routes.ts:94-95 — Changed maximum: 500maximum: 200 and max: 500max: 200 in the description to match MAX_EVENTS_PAGE_SIZE.

Verification

The /api-docs.json endpoint is generated dynamically from the JSDoc annotations via swagger-jsdoc, so the corrected value will appear automatically.

Closes #814

@CHKM001

CHKM001 commented Jun 30, 2026

Copy link
Copy Markdown
Contributor Author

@ogazboiz ready...

@ogazboiz

ogazboiz commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

your branch is green, but it went conflicting after the ci fixes landed on main: #969 and #974 touched backend/Dockerfile and backend/src/workers/soroban-event-worker.ts, which this pr also edits. please rebase on main and it should be good to go: git fetch origin && git rebase origin/main && git push --force-with-lease. if any of your Dockerfile or soroban-event-worker changes overlap what #969 already did (copying prisma/ into the runner, and the import type { Prisma } from '../generated/prisma' fix), drop those now-redundant bits and keep just your actual change. i'll re-review and merge once it's rebased and ci is green.

@CHKM001

CHKM001 commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

okay thank you will hash it out in a bit

@CHKM001 CHKM001 force-pushed the fix/events-limit-max-200 branch from fb82464 to 5d7cf86 Compare July 1, 2026 09:40
Closes LabsCrypt#814

GET /v1/streams/{streamId}/events documented limit parameter with
maximum: 500 but the runtime code caps at MAX_EVENTS_PAGE_SIZE (200).
A client requesting limit=400 would silently receive at most 200 rows,
contradicting the published contract.

Changed maximum: 500 -> maximum: 200 in the JSDoc annotation to match
the existing MAX_EVENTS_PAGE_SIZE constant in events.routes.ts.
@CHKM001 CHKM001 force-pushed the fix/events-limit-max-200 branch from 681a631 to 40f6fc5 Compare July 1, 2026 10:15
@CHKM001

CHKM001 commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

@ogazboiz I have done it as requested. Please merge!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Docs] GET /v1/streams/:streamId/events OpenAPI says limit max 500 but the code caps at 200

2 participants