Repository navigation
Add Zod validation schema for pagination query parameters across list endpoints #440
Copy link
Copy link
Closed
Labels
Stellar WaveIssues in the Stellar wave programIssues in the Stellar wave programbackendcomplexity: trivialDrips Wave — small, well-bounded taskDrips Wave — small, well-bounded taskdrips-waveTracked in a Drips Wave programTracked in a Drips Wave programenhancementNew feature or requestNew feature or request
Description
Description — what to implement and the why/impact.
Many list endpoints (such as groups, expenses, and transaction history) accept pagination query parameters like limit and page or cursor. Currently, these are often parsed manually or left unvalidated, which can lead to invalid SQL offsets, negative limits, or excessive database loads. Implementing a reusable Zod pagination query schema standardizes input validation and protects the API against malformed query strings.
Context & Requirements — background, constraints, design references, edge cases;
grounded in the actual repo (real files, stack, conventions).
- The codebase uses Fastify with Zod for all request validation.
- Create a shared pagination validation schema in a utility file or within common schemas.
- Ensure defaults are handled safely (e.g.,
limitdefaults to 20, max limit capped at 100,pageorcursordefaults correctly). - Handle edge cases such as non-numeric strings, negative numbers, and zero values.
Acceptance Criteria — a checklist ("- [ ] ...") of specific, testable conditions that define "done".
- Create a reusable Zod schema
paginationQuerySchemainsrc/schemas/common.ts(or similar schema file). - Validate
limitas a positive integer with a maximum cap and default value. - Validate optional
cursororpageparameters. - Add unit tests verifying correct parsing, default values, and rejection of invalid bounds.
Implementation Guidance — likely files/modules to touch (use real paths from the repo context) and a suggested approach, without over-prescribing.
- Likely files:
src/schemas/common.ts(or create it if needed), and corresponding unit test files. - Follow the existing Zod schema definitions used throughout the API routes.
Testing & Validation — how the contributor should prove it works (tests to add/run, manual checks, screenshots for UI).
- Run
npm testto ensure existing and new unit tests pass successfully. - Add dedicated unit tests for
paginationQuerySchematesting edge cases like negative limits and strings.
Submission Guidelines — must open a PR that includes "Closes #"; assignment is required before starting; follow the repo's existing style and conventions.
Wave complexity: Trivial
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Stellar WaveIssues in the Stellar wave programIssues in the Stellar wave programbackendcomplexity: trivialDrips Wave — small, well-bounded taskDrips Wave — small, well-bounded taskdrips-waveTracked in a Drips Wave programTracked in a Drips Wave programenhancementNew feature or requestNew feature or request
Activity
Ranjeet2063 commentedon Sep 7, 2026
Hello @maintainers,
I'd love to take ownership of this issue.
Technical Approach:
Add Zod validation schema for pagination query parameters across list endpointswith strict input validation, proper HTTP error codes, and idempotent mutations.Background: Committed to clean architecture, zero-bloat code, and fast 12-24h turnaround.
Looking forward to contributing—please feel free to assign!
shobhamerabacha-star commentedon Sep 9, 2026
Hey team,
I would love to take this on. My planned approach:
Add Zod validation schema for pagination query parameters across list endpointswith strict input validation, proper HTTP error codes, and idempotent execution.Ready to deliver a clean, tested PR within 12–24 hours. Please assign!
ranjeet150 commentedon Sep 13, 2026
Hello! I'd like to work on this issue.
I would like to resolve this issue. Here is my proposed execution plan:
Add Zod validation schema for pagination query parameters across list endpointswith strict input validation, proper HTTP error codes, and idempotent execution.I am ready to start immediately—please assign this to me!
VeronicDev commentedon Sep 25, 2026
@VeronicDev has applied to work on this issue as part of the Stellar Wave Program's 9th wave.
ℹ️ Repo Maintainers: To accept this application, review their application or assign @VeronicDev to this issue.
amiramusa187-glitch commentedon Sep 25, 2026
@amiramusa187-glitch has applied to work on this issue as part of the Stellar Wave Program's 9th wave.
ℹ️ Repo Maintainers: To accept this application, review their application or assign @amiramusa187-glitch to this issue.
Fave2 commentedon Sep 25, 2026
@Fave2 has applied to work on this issue as part of the Stellar Wave Program's 9th wave.
ℹ️ Repo Maintainers: To accept this application, review their application or assign @Fave2 to this issue.
drips-wave commentedon Sep 25, 2026
Congratulations, @Fave2! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on September 30, 2026.
🧑💻 @Fave2: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.
Warning
When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.
🤠 Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.
🌊 Happy Wave 🌊
feat: shared pagination schema access point, auth token tests, prisma…
drips-wave commentedon Sep 25, 2026
This issue has been completed by @Fave2 as part of the Stellar Wave Program's 9th Wave 🥳
😎 @Fave2: You earned 200 Points for completing this issue! After the current Wave ends, you'll be eligible for a percentage of the Wave's reward pool based on the percentage of total points you've earned. Learn more here. You can also Leave a review to share your experience working on this issue.
🧑💻 Repo maintainers: How'd the contributor do? Leave a review to share your experience working with them.