Skip to content

Documentation typo/error in the "Formatting errors" page #4819

Description

@novaotp

Hey, I found a documentation typo/error in the z.flattenError() section at https://zod.dev/error-formatting.

This is the current example :

flattened.fieldErrors.string; // => [ 'Invalid input: expected string, received number' ]
flattened.fieldErrors.numbers; // => [ 'Invalid input: expected number, received string' ]

But it should be :

flattened.fieldErrors.username; // => [ 'Invalid input: expected string, received number' ]
flattened.fieldErrors.favoriteNumbers; // => [ 'Invalid input: expected number, received string' ]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions