Skip to content

feat: add input validation and sanitization to all API endpoints (#338)#458

Open
Julianemeka wants to merge 1 commit into
AnnabelJoe:mainfrom
Julianemeka:feature/api-validation
Open

feat: add input validation and sanitization to all API endpoints (#338)#458
Julianemeka wants to merge 1 commit into
AnnabelJoe:mainfrom
Julianemeka:feature/api-validation

Conversation

@Julianemeka
Copy link
Copy Markdown

Added comprehensive input validation and sanitization to all API endpoints using Zod.

Changes:

  • Enforced Zod schema validation on all request bodies, path parameters, and query parameters.
  • Applied .trim() to all string fields to prevent whitespace issues and basic injection.
  • Enforced strict numeric bounds (e.g., kwh > 0, limit within 1-100).
  • Validated UUID formats for all ID parameters.
  • Standardized error responses to return 400 with descriptive validation errors.
  • Applied validation before any business logic in every route.

Closes #338

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Jun 4, 2026

@Julianemeka Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add input validation and sanitization to all API endpoints

1 participant