Repository navigation
chore(deps): bump zod to v4 - #10624
Open
kwburns-kong wants to merge 2 commits into
Open
kwburns-kong wants to merge 2 commits into
kwburns-kong wants to merge 2 commits into
Conversation
Also drops the non-standard format: starts_with that Zod 4 emits, since the sibling pattern already enforces the prefix.
|
✅ KSAI Review: Finished
Run report (federated) · 1 paid run · $0.1081 total
Reviewing cost $0.1077; deciding how to run it cost $0.0004 |
There was a problem hiding this comment.
| Check | Result |
|---|---|
| Scope | Zod 3.25 to 4.6.5 upgrade: version bumps in two packages, z.undefined().optional() union fixes, regenerated JSON schema (oneOf, type arrays, format drop), updated union-error test expectation. |
| Mandate | typescript-code-review |
| Findings | None |
| Findings audit | Skipped (no candidate findings) |
The migration is consistent. z.undefined().optional() preserves union discrimination: present non-undefined values still fail a branch, absent keys pass. The unchanged parser tests cover both directions.
The regenerated schema keeps validation semantics. Every converted union has unique const discriminators with required: ["type"], so oneOf matches anyOf for all inputs. The permissive outer fallback stays anyOf. The generator's format drop matches the committed file; the sibling pattern keys enforce the prefixes.
No additional concerns found.
This branch has not been deployed
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.
Summary
Split out of #10587. The
zodmajor bump may affect INS-3039 (relies on V3 parser behavior) and git sync, so it is reviewed and validated independently.Dependency bumps
Adjustments for major upgrade
z.undefined()toz.undefined().optional()for themethod,url,parameters,pathParametersandchildrenkeys inimport-v5-parser.tsdue to zod 4 treating a requiredz.undefined()key as non-optional, so absent keys failed the RequestCollectionSchema union discriminatorsdeep-strict.test.tsauth expectation frominvalid_uniontounrecognized_keys(with keys['type', 'apiKey']) due to zod 4 reporting the strict empty-object fallback branch's issue directly instead of a wrappinginvalid_unionschemas/insomnia.schema.5.1.jsonandpackages/insomnia/scripts/generate-schema.ts: zod 4 emitsformat: "starts_with"forz.string().startsWith(), which is not a draft 2020-12 format and makes strict Ajv fail to compile the schema. The generator now drops that format; the siblingpatternkeys still enforce the prefixTo validate
check-schema-mismatch.tsstill receives the wrappinginvalid_unionthatpickBestBranchunwraps