Request validation for the mockup simulator of a generated SDK.
A simulated function does not call a server. It validates its input with
typia and, when the input is wrong, throws the HttpError with status 400
that the real server would answer with.
Evidence
contracts/common.md#principled-implementation Each validator runs the caller's assertion and converts a readable typia TypeGuardError shape into an HttpError 400 whose JSON body carries the method, path, expected type and value plus a message naming the failing part. A shared snapshot reads each needed property once; malformed or unreadable shapes rethrow the caller's original value. Payload values must support JSON serialization, whose errors still propagate.
Evidence
contracts/common.md#clear-and-simple-design One public entry point, assert, returns four validators that differ only in their message, sharing one private conversion; the shape snapshot reader and the error interface are module-private.
Evidence
contracts/common.md#prohibited-implementation-shortcuts Classification checks the readable error structure (method, path, expected type, name, message and stack) rather than its class, then captures the payload value. A value that lacks any of those fields with the expected types, or whose property access throws, is not classified as a type guard failure and is rethrown unchanged; unrelated task errors are neither replaced nor swallowed.
Evidence
contracts/common.md#meaningful-documentation The comment states what the simulator validates and what it throws.
Request validation for the mockup simulator of a generated SDK.
A simulated function does not call a server. It validates its input with typia and, when the input is wrong, throws the
HttpErrorwith status 400 that the real server would answer with.Evidence
contracts/common.md#principled-implementation Each validator runs the caller's assertion and converts a readable typia
TypeGuardErrorshape into anHttpError400 whose JSON body carries the method, path, expected type and value plus a message naming the failing part. A shared snapshot reads each needed property once; malformed or unreadable shapes rethrow the caller's original value. Payload values must support JSON serialization, whose errors still propagate.Evidence
contracts/common.md#clear-and-simple-design One public entry point,
assert, returns four validators that differ only in their message, sharing one private conversion; the shape snapshot reader and the error interface are module-private.Evidence
contracts/common.md#prohibited-implementation-shortcuts Classification checks the readable error structure (method, path, expected type, name, message and stack) rather than its class, then captures the payload value. A value that lacks any of those fields with the expected types, or whose property access throws, is not classified as a type guard failure and is rethrown unchanged; unrelated task errors are neither replaced nor swallowed.
Evidence
contracts/common.md#meaningful-documentation The comment states what the simulator validates and what it throws.