Summary
Validation errors (invalid params, exceeded limits, malformed input) are returned with inconsistent shapes across different endpoints. A shared helper that builds a standardized 422 response body should be used everywhere a validation error is returned.
Scope
- Add
buildValidationError(field: string, message: string, code: string): ValidationErrorResponse helper
- Response shape:
{ error: { code, field, message } }
- Add unit tests confirming the shape is correct for several different field and message combinations
Acceptance Criteria
ETA: 12 hours
Coordinate on Telegram
Summary
Validation errors (invalid params, exceeded limits, malformed input) are returned with inconsistent shapes across different endpoints. A shared helper that builds a standardized 422 response body should be used everywhere a validation error is returned.
Scope
buildValidationError(field: string, message: string, code: string): ValidationErrorResponsehelper{ error: { code, field, message } }Acceptance Criteria
ETA: 12 hours
Coordinate on Telegram