fix: align OpenAPI events limit max with code constant (500 -> 200)#942
Conversation
|
@ogazboiz ready... |
|
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: |
|
okay thank you will hash it out in a bit |
fb82464 to
5d7cf86
Compare
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.
681a631 to
40f6fc5
Compare
|
@ogazboiz I have done it as requested. Please merge! |
ogazboiz
left a comment
There was a problem hiding this comment.
verified: the code enforces MAX_EVENTS_PAGE_SIZE = 200, but the openapi doc said max 500. this aligns the doc to the actual code constant (500 -> 200). correct. merging.
PR #814 Fix OpenAPI events limit max mismatch (500 → 200)
Problem
GET /v1/streams/{streamId}/eventsdocumentedlimitparameter withmaximum: 500instream.routes.ts:94, but the runtime code inevents.routes.ts:24definesMAX_EVENTS_PAGE_SIZE = 200and the controller clamps to that value. A client requestinglimit=400would silently receive at most 200 rows, contradicting the published contract.Change
backend/src/routes/v1/stream.routes.ts:94-95— Changedmaximum: 500→maximum: 200andmax: 500→max: 200in the description to matchMAX_EVENTS_PAGE_SIZE.Verification
The
/api-docs.jsonendpoint is generated dynamically from the JSDoc annotations viaswagger-jsdoc, so the corrected value will appear automatically.Closes #814