closes #4850: fix non informative error output for bad meta field when using z.prettifyError on parsed z.union schema#4870
Open
vladavoX wants to merge 1 commit into
Open
Conversation
🦋 Changeset detectedLatest commit: 4ccd1ef The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
@vladavoX is attempting to deploy a commit to the Vercel Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
e23a171 to
4ccd1ef
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why:
Closes: #4850
What's being changed (if available, include any code snippets, screenshots, or gifs):
I've made the same safeParse checks, just for each type, one by one, thus the prettify can do its thing since parse response is not from union. This is how it looks with fix.
z.prettifyErrordoesn't work well with unions, because it is reporting ton of issues for each union it checks, here is a simple example, where it just pulls out themessage: Invalid inputat the end (same issue as here):Check off the following:
deployment link in this PR's timeline (this link will be available after
opening the PR).