Files
elysiajs-elysia/src
RAUNAK 2872e3bfa4 fix: response validation returns 500 instead of 422 for nested schemas (#1659)
When response validation fails on complex nested schemas (Tuples, Unions with
Objects), the dynamic handler (aot: false) was returning 500 Internal Server
Error instead of 422 Validation Error.

Root cause: exact-mirror's Clean() function generates code that directly
accesses nested properties without null checks. When called on invalid data
(e.g., ver: null instead of ver: {s: '', m: null}), it throws a TypeError.

Fix: Wrap Clean() calls in try-catch in dynamic-handle.ts, consistent with
how compose.ts (AOT mode) already handles this.

- Invalid nested response now returns 422 with proper error details
- Error includes path (/items/1/1/file/ver) and message (Expected object)
- Valid responses still return 200 as expected
- Both aot:true and aot:false now behave consistently

Closes #1659
2026-01-18 01:34:54 +05:30
..
2026-01-14 11:33:45 +07:00
2025-11-26 03:18:32 +08:00
2025-11-16 17:28:32 +01:00
2026-01-05 07:43:35 +07:00
2025-09-07 18:54:34 +07:00
2026-01-14 11:52:48 +07:00
2025-02-01 19:48:35 +07:00
2025-11-17 16:52:01 +07:00
2026-01-03 21:19:44 +07:00
2026-01-04 18:40:50 +07:00
2025-05-27 18:05:55 +07:00
2025-12-26 01:07:13 +07:00
2026-01-14 10:56:47 +07:00