Skip to content

[Backend] Fix swagger doc/route mismatch: cancel doc above top-up route; top-up undocumented #539

Description

@ogazboiz

Telegram: https://t.me/+DOylgFv1jyJlNzM0

Why this matters

In backend/src/routes/v1/stream.routes.ts the OpenAPI @openapi block for /v1/streams/{streamId}/cancel sits directly above the top-up route registration:

/**
 * @openapi
 * /v1/streams/{streamId}/cancel: ...
 */
router.post('/:streamId/top-up', authMiddleware, topUpStreamHandler);
router.post('/:streamId/cancel', authMiddleware, cancelStreamHandler as any);

So the generated docs attribute the cancel spec to the wrong route, and POST /v1/streams/{streamId}/top-up has no OpenAPI documentation at all (the real cancel doc lives in controllers/stream/cancel.ts).

Acceptance criteria

  • Add a proper @openapi block for POST /v1/streams/{streamId}/top-up (request body: { amount: string }, 200/400/401/403/404 responses)
  • Remove or relocate the duplicated cancel @openapi block so it doesn't sit above the top-up route
  • /api-docs.json shows both top-up and cancel correctly

Files to touch

  • backend/src/routes/v1/stream.routes.ts

Out of scope

  • The cancel handler doc in controllers/stream/cancel.ts (already correct).

Activity

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

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programbackendBackend related tasksdocsDocumentationgood first issueGood for newcomers

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions