question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Return all schema errors

See original GitHub issue

How do I get Zod to return all the errors. Currently schema.parse throws on the first error. Something like yup’s {abortEarly: false} would be nice

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
ozimoscommented, Jun 14, 2020

@vriad In the dump above, I am typing into the form inputs and logging to console at lines 24 and 33 of App.tsx. In the console dump above, there is only one error from zod even when both email and confirmPassword fields are wrong. As soon as I fix the email field the sole error message switches from “Invalid email address.” to “Both password and confirmation must match”

0reactions
brabejicommented, Aug 2, 2020

@vriad I’ve just encountered some missing errors as seen in #107

I’m building zod+mobx typesafe form state library. Previously I had some success with joi + typesafe-joi but some nasty hacks were needed. So I’m really happy to see zod to take off. Thank you! ❤️

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to return all errors of a schema using RestAssured
I am trying to validate a schema using RestAssured. I have a response { "a" : 1, "b" : 1, "c" : 1...
Read more >
Understanding schema errors | HESA
1) Invalid values. In these examples the error message states that the value returned is invalid. · 2) Invalid child elements · 3)...
Read more >
How to get ALL xml schema validation errors with XmlReader ...
I have an XML string and a Schema loaded up and passed into a function. I have it validating the XML against the...
Read more >
Validation result - Opis JSON Schema
Get all errors that occurred during validation. An empty array is returned if there were no errors. Returns array|\Opis\JsonSchema\ValidationError[] ...
Read more >
Handling Validation Errors - python-jsonschema
When an invalid instance is encountered, a ValidationError will be raised or returned, depending on which method or function is used. exception jsonschema....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found