Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/docs/content/error-formatting.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Zod emphasizes _completeness_ and _correctness_ in its error reporting. In many
Consider this simple object schema.

```ts
const schema = z.object({
const schema = z.strictObject({
username: z.string(),
favoriteNumbers: z.array(z.number()),
});
Expand All @@ -22,6 +22,7 @@ Attempting to parse this invalid data results in an error containing two issues.
const result = schema.safeParse({
username: 1234,
favoriteNumbers: [1234, "4567"],
extraKey: 1234,
});

result.error!.issues;
Expand Down