Skip to content

Add helper for building a standardized 422 validation error response shape #490

Description

@Chucks1093

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

  • Helper returns correct shape with all three fields
  • Used consistently across all 422 responses in the codebase
  • Unit tests cover multiple field and message combinations

ETA: 12 hours


Coordinate on Telegram

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions