Repository navigation
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the codebase to support Zod 4 by replacing references to ZodError.errors with ZodError.issues, utilizing string literals instead of z.ZodIssueCode enums, and handling nested 2D issue arrays for invalid_union errors. Additionally, corresponding unit tests have been added to verify these changes. There are no review comments, so I have no feedback to provide.
|
Hi @gspencergoog, Could you please take a look? |
gspencergoog
left a comment
There was a problem hiding this comment.
This pull request updates @a2ui/web_core validation error formatting to use ZodError.issues instead of ZodError.errors, replaces z.ZodIssueCode enum reads with string literals, and adds fallback handling for Zod 4's 2D errors array on invalid_union issues. These changes improve forward compatibility with Zod 4 without introducing regressions. As verified through code inspection of google3's colinhacks_zod (v3.25.76) and local runtime execution, all changes are fully backward-compatible with Zod 3 used in google3.
🤖 Agent-generated
Description
This PR updates
@a2ui/web_corevalidation error handling to readerror.issuesinstead of the deprecatederror.errorsalias acrosspayload-validator.tsandprocessing/adapters/base.ts, and updatesformatZodIssueinformat-zod-issue.tsto match issue codes via string literals without relying on the Zod 3 runtimez.ZodIssueCodeobject. This preventsTypeErrorcrashes when downstream projects resolve Zod 4 and ensuresA2uiValidationErrordiagnostics surface cleanly across both Zod 3 and Zod 4. It also adds unit tests covering Zod 4 error shapes inmessage-processor.test.ts.Fixes #3812
Pre-launch Checklist
One time:
For this PR:
If you need help, consider asking for advice on the discussion board.