Skip to content

Add Zod validation schema for pagination query parameters across list endpoints #440

Closed

Description

@Cjay-Cyber-2

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., limit defaults to 20, max limit capped at 100, page or cursor defaults 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 paginationQuerySchema in src/schemas/common.ts (or similar schema file).
  • Validate limit as a positive integer with a maximum cap and default value.
  • Validate optional cursor or page parameters.
  • 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 test to ensure existing and new unit tests pass successfully.
  • Add dedicated unit tests for paginationQuerySchema testing 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

Activity

  1. Ranjeet2063 commented on Sep 7, 2026

    @Ranjeet2063
    Contributor

    Hello @maintainers,

    I'd love to take ownership of this issue.

    Technical Approach:

    1. Core Work: Structure the backend handler for Add Zod validation schema for pagination query parameters across list endpoints with strict input validation, proper HTTP error codes, and idempotent mutations.
    2. Quality Gate: Include integration tests covering both valid payloads and edge-case errors.

    Background: Committed to clean architecture, zero-bloat code, and fast 12-24h turnaround.

    Looking forward to contributing—please feel free to assign!

  2. shobhamerabacha-star commented on Sep 9, 2026

    @shobhamerabacha-star

    Hey team,

    I would love to take this on. My planned approach:

    • Structure backend handlers for Add Zod validation schema for pagination query parameters across list endpoints with strict input validation, proper HTTP error codes, and idempotent execution.
    • Cover implementation with end-to-end integration tests for standard and edge-case inputs.

    Ready to deliver a clean, tested PR within 12–24 hours. Please assign!

  3. ranjeet150 commented on Sep 13, 2026

    @ranjeet150

    Hello! I'd like to work on this issue.

    I would like to resolve this issue. Here is my proposed execution plan:

    • Implementation: Structure backend handlers for Add Zod validation schema for pagination query parameters across list endpoints with strict input validation, proper HTTP error codes, and idempotent execution.
    • Testing & Verification: Cover implementation with end-to-end integration tests for standard and edge-case inputs.
    • Delivery: Ready to ship a thoroughly tested PR within 12–24 hours with passing CI.

    I am ready to start immediately—please assign this to me!

  4. VeronicDev commented on Sep 25, 2026

    @VeronicDev
    Contributor

    @VeronicDev has applied to work on this issue as part of the Stellar Wave Program's 9th wave.

    Hello Maintainer, I can fix this please assign.

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @VeronicDev to this issue.

  5. amiramusa187-glitch commented on Sep 25, 2026

    @amiramusa187-glitch

    @amiramusa187-glitch has applied to work on this issue as part of the Stellar Wave Program's 9th wave.

    Hi, can I work on this please?

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @amiramusa187-glitch to this issue.

  6. Fave2 commented on Sep 25, 2026

    @Fave2
    Contributor

    @Fave2 has applied to work on this issue as part of the Stellar Wave Program's 9th wave.

    pleae assign

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @Fave2 to this issue.

  7. drips-wave commented on Sep 25, 2026

    @drips-wave

    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 🌊

  8. drips-wave commented on Sep 25, 2026

    @drips-wave

    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.

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 programbackendcomplexity: trivialDrips Wave — small, well-bounded taskdrips-waveTracked in a Drips Wave programenhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions