[question] is it possible to stop parsing on the first error?
See original GitHub issueI’m using Zod to validate HTTP payloads, some of which may be expensive to validate. Is it possible for schema.parse()
and their friends to stop on the first error and return a single ZodIssue?
Issue Analytics
- State:
- Created a year ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Don't stop parsing after first exception - Stack Overflow
In general you should avoid TokenMgeErrors. Usually this can be accomplished with a "catch all" rule -- see the FAQ for details.
Read more >TMF (Xtext) » Stop lexing and parsing ... - Eclipse Community Forums
Greetings everybody, Is it possible with Xtext 1.0.1 to tell the underlying ANTLR to stop the lexing and parsing process at the first...
Read more >How to fix parse error there was a problem parsing ... - YouTube
How to fix Parse Error There was a problem parsing the package.1. Allow Apps Installation from Unknown Sources.2.Enable USB Debugging.3: ...
Read more >Parse Error: What It Is and How to Fix It - Lifewire
When you get a parse error on your Android phone, it means the phone wasn't able to install your app. Check out our...
Read more >How To Fix The WordPress Parse Error Easily - Muffin Group
A WordPress parse error is serious. It will block access to the website and readers will not be able to view the content....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
There is support for aborting early when using .superRefine. It is more work but might fit your use case.
hey, @colinhacks, first of all, thank you for the great work 💪🏽! I understand that’s not the intended original use case for Zod. I’m moving from Joi – which I like, but lacks the type inference Zod does so well – and my idea was to migrate all schemas. My problem is that I’ve been also using Joi to validate HTTP payloads on a Hapi service and some of those validations can be expensive.
Maybe my case is too specific, and it wouldn’t worth the changes, but maybe HTTP payload validation could be a new use case that Zod might also address 😃 Otherwise, and obviously, please, close the issue – I don’t want to bother you with things out of the scope of the project.