Skip to content

Function: describeIssues()

ts
function describeIssues(
   issues, 
   body, 
   base?): SchemaMismatchIssue[];

Defined in: src/core/schemaMismatch.ts:153

Flattens zod's issues into the report's own vocabulary.

Union branches are flattened rather than nested: a caller reading this wants to know which field is wrong, and telling them the response failed all four branches of a union is a fact about zod, not about their data. The two container codes are flattened for the same reason — a bad key or element is a problem with what is inside, and zod's own nesting of it says nothing the inner issue does not.

Parameters

ParameterTypeDefault value
issuesreadonly $ZodIssue[]undefined
bodyunknownundefined
basePropertyKey[][]

Returns

SchemaMismatchIssue[]