StructIssue
A single validation failure produced while parsing a struct.
@defjs/core · Type
Signature
interface StructIssue { code: | "custom" | "invalid_enum" | "invalid_intersection" | "invalid_literal" | "invalid_type" | "invalid_union" | "missing_key"; expected: string; message: string; path: Path; received: unknown; }
-
codeis the machine-readable category. The parser producesinvalid_type,invalid_literal,invalid_enum,invalid_union,invalid_intersection, andmissing_key;customis part of the type, but the built-in structs never produce it. -
expecteddescribes the expected type or value. -
messageis the final text, after an optional ErrorMap rewrite. -
pathruns from the parse root to the failing location: field names and array indices. It is empty for a root-level failure. -
receivedis the value that failed atpath.
Members
Prop
Type
code "custom" | "invalid_enum" | "invalid_intersection" | "invalid_literal" | "invalid_type" | "invalid_union" | "missing_key"Machine-readable failure category.
expected stringHuman-readable description of the expected type or value.
message stringFinal message after optional ErrorMap rewriting. The default names the received kind, not the value.
path PathPath from the parse root to the failing location.
received unknownValue that failed validation at path.