-
Notifications
You must be signed in to change notification settings - Fork 27
Open
Labels
Stellar WaveIssues in the Stellar wave programIssues in the Stellar wave program
Description
Description
Introduce request validation using a schema library (e.g. Zod): validate query, params, and body for selected routes. Return 400 with validation errors in a consistent format when validation fails.
Requirements and context
- Must validate input before business logic
- Return clear error messages for invalid fields
- Reusable validator middleware (e.g. validate(schema))
Suggested execution
- Fork the repo and create a branch
git checkout -b feature/request-validation- Implement changes
- Add zod (or similar) dependency
- Add
src/middleware/validate.ts: accept schema(s), validate req.body/query/params, next() or pass errors to error handler - Apply to one or two existing routes as example
- Test and commit
- Test with invalid payload and verify 400 and error shape
- Example commit message:
feat: request validation middleware with zod
Guidelines
- Consistent validation error format
- Clear documentation
- Timeframe: 96 hours
- Project details: #
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Stellar WaveIssues in the Stellar wave programIssues in the Stellar wave program