isValidationError
Type guard to distinguish Kizuna validation errors from custom 400 responses on the client.
Distinguish a Kizuna validation error from a route's own 400 body. Every generated fetch client exports it:
Parameters
ValidationError shape
An RFC 9457 Problem Details body with an errors extension:
code is typed as ValidationIssueCode, so the built-in Zod codes are offered as autocomplete suggestions, while any custom string (e.g. one emitted via k.issue) is still assignable.
Common error codes: invalid_type, too_small, too_big, invalid_string_format, unrecognized_keys, not_multiple_of, custom. To emit your own machine-readable code from a .superRefine() check, see k.issue.
Example
When a route declares its own 400 response, the client sees a union of your type and ValidationError. Use isValidationError to distinguish them:
A route that declares no 400 of its own needs no guard: result.status === 400 already narrows to ValidationError.
See the Fetch client guide for more details.