Skip to content

Ref : Implemented strict Zod request schema validation in scheme eligibility checker #2156

Merged
dipexplorer merged 1 commit into
RatLoopz:mainfrom
hrx01-dev:Ref/Implement-strict-Zod-request-schema-validationin-scheme-eligibility-checker
Jun 20, 2026
Merged

Ref : Implemented strict Zod request schema validation in scheme eligibility checker #2156
dipexplorer merged 1 commit into
RatLoopz:mainfrom
hrx01-dev:Ref/Implement-strict-Zod-request-schema-validationin-scheme-eligibility-checker

Conversation

@hrx01-dev

@hrx01-dev hrx01-dev commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

🛑 STOP: Assignment & File Scope Check

  • I am assigned to this issue.
  • I verified that this PR ONLY touches the required files.

Warning

PRs with unrelated files will not be reviewed and may be closed.

📋 PR Summary & Link

  • **Closes [Security/Refactor] Implement strict Zod request schema validation in scheme eligibility checker #2104 **
  • Summary:
  • Defined a Strict Zod Schema: Created an eligibilitySchema to properly parse and enforce requirements on the incoming request body, such as rejecting negative numbers for age and annual_income, and making sure family_size is at least 1.
  • Replaced Unsafe Type Casting: The route now parses the payload using eligibilitySchema.safeParse(req.body) instead of unsafely typing the request with as EligibilityBody.
  • Error Handling: If validation fails, the API gracefully rejects the request by immediately returning a 400 Bad Request containing the specific validation issues before executing any processing logic.

📸 Proof of Work (Screenshots / Logs)

Important

No Pull Request will be merged without proof of testing!

  • Frontend/UI changes: You MUST attach screenshots or screen recordings (GIFs/Videos) showing the UI changes.

Please drag & drop your screenshots/GIFs here:

🏷️ PR Type

  • 🐛 type: bug
  • type: feature
  • 📖 type: docs
  • 🧪 type: testing
  • 🔒 type: security
  • type: performance
  • 🎨 type: design
  • ♻️ type: refactor
  • 🛠️ type: devops
  • type: accessibility

✅ Checklist

  • My PR has a linked issue (Closes #123)
  • I have pulled the latest main and resolved any conflicts

@github-project-automation github-project-automation Bot moved this to 📥 Backlog in SahiDawa Workflow Jun 20, 2026
@github-actions github-actions Bot added gssoc:approved Approved for gssoc good first issue Good for newcomers level:intermediate 35 pts quality:clean multiplier x1.2 status: open-for-all type:security Auth, rate limiting, security and removed type:security Auth, rate limiting, security labels Jun 20, 2026
@hrx01-dev hrx01-dev changed the title Ref : Implemented strict Zod request schema validation in scheme elig… Ref : Implemented strict Zod request schema validation in scheme eligibility checker Jun 20, 2026
@dipexplorer dipexplorer added level:beginner 20 pts type:refactor Code structure cleanup without behavior change labels Jun 20, 2026
@dipexplorer dipexplorer merged commit ba31bae into RatLoopz:main Jun 20, 2026
17 of 20 checks passed
@github-project-automation github-project-automation Bot moved this from 📥 Backlog to 🎉 Merged in SahiDawa Workflow Jun 20, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🎉 Congratulations @hrx01-dev! Your Pull Request "Ref : Implemented strict Zod request schema validation in scheme eligibility checker " has been successfully merged by @dipexplorer.

Thank you for your valuable contribution to SahiDawa! 🇮🇳
If this was for GSSoC 2026, your work is officially merged and valid. Keep up the great work and feel free to claim other open issues. 🚀

Follow us on LinkedIn: https://www.linkedin.com/company/ratloopz/ to get shoutout

@dipexplorer dipexplorer removed the level:beginner 20 pts label Jun 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

good first issue Good for newcomers gssoc:approved Approved for gssoc level:intermediate 35 pts quality:clean multiplier x1.2 status: open-for-all type:refactor Code structure cleanup without behavior change type:security Auth, rate limiting, security

Projects

Status: 🎉 Merged

Development

Successfully merging this pull request may close these issues.

[Security/Refactor] Implement strict Zod request schema validation in scheme eligibility checker

2 participants