Skip to content

feat(backend): Enable input validation and response envelope 🛡️ - Ad… - #237

Merged
Cedarich merged 1 commit into
Zyntarivoid:mainfrom
datagerl:feat/backend-input-validation-response-envelope-takeoff
Jul 23, 2026
Merged

feat(backend): Enable input validation and response envelope 🛡️ - Ad…#237
Cedarich merged 1 commit into
Zyntarivoid:mainfrom
datagerl:feat/backend-input-validation-response-envelope-takeoff

Conversation

@datagerl

Copy link
Copy Markdown
Contributor

Summary 🎉

Aligns the active backend with its documented conventions for input validation and response shape!

Changes Made 🚀

  1. Enabled Global Request Validation (main.ts:10-14):

    • Added ValidationPipe with whitelist: true, forbidNonWhitelisted: true, and transform: true
    • Now invalid payloads are caught automatically!
  2. Created Response Transform Interceptor (src/common/interceptors/transform.interceptor.ts):

    • Wraps all successful responses in ApiResponseDto envelope
    • Maintains flexibility for responses already using ApiResponseDto
  3. Created Http Exception Filter (src/common/filters/http-exception.filter.ts):

    • Catches all HttpExceptions (including validation errors)
    • Returns errors in predictable ApiResponseDto format with success: false

Acceptance Criteria Check ✅

  • Global request validation is enabled.
  • Active routes return a consistent envelope where intended.
  • Invalid payloads fail with predictable formatting.

closes #197

…ed global validation pipe to catch pesky invalid payloads - Created transform interceptor to wrap all responses in a cozy envelope - Built exception filter to make errors predictable (and less scary)
@Cedarich
Cedarich merged commit f6b7030 into Zyntarivoid:main Jul 23, 2026
1 check passed
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.

26. Standardize backend responses with a global validation pipe and API envelope

2 participants