Conversation
|
|
🦋 Changeset detectedLatest commit: cda5297 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
TL;DR — Fixes Zod schema generation so Key changes
Summary | 98 files | 1 commit | base:
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #3759 +/- ##
==========================================
- Coverage 40.11% 40.08% -0.03%
==========================================
Files 521 521
Lines 19261 19273 +12
Branches 5733 5727 -6
==========================================
Hits 7726 7726
- Misses 9339 9345 +6
- Partials 2196 2202 +6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
@hey-api/codegen-core
@hey-api/json-schema-ref-parser
@hey-api/nuxt
@hey-api/openapi-ts
@hey-api/shared
@hey-api/spec-types
@hey-api/types
@hey-api/vite-plugin
commit: |
There was a problem hiding this comment.
Reviewed — no issues found.
The core fix is correct: for optional fields with defaults, .default(value).optional() produces the right z.infer type (T | undefined), whereas the old .optional().default(value) collapsed to just T (required). The nullish branch correctly keeps .default() after .nullish() since that wraps both null and undefined in one call.
Two secondary changes worth noting (both seem intentional):
.default()dropped for non-optional, non-nullable fields — required fields no longer get a Zod.default(), so validation will rejectundefined. This is more correct for client schemas where the server applies the default, but it's a behavioral change beyond what the changeset title describes.- Test infra refactoring — output dir changed from
.gen/snapshotsto.tmp, withglobalTeardown.tsfor cleanup and sharedconstants.ts. The root.gitignorealready covers.tmp, so the local.gitignorecleanup is safe.
Task list (4/4 completed)
- Read the diff: changeset, core walker changes, and test infrastructure
- Read snapshot changes to understand the behavioral impact
- Trace data flow in walker changes for correctness
- Self-critique and submit review
There was a problem hiding this comment.
Reviewed — no issues found.
The core fix is correct: for optional fields with defaults, .default(value).optional() produces the right z.infer type (T | undefined), whereas the old .optional().default(value) collapsed to just T (required). The nullish branch correctly keeps .default() after .nullish() since that wraps both null and undefined in one call.
Two secondary changes worth noting (both seem intentional):
.default()dropped for non-optional, non-nullable fields — required fields no longer get a Zod.default(), so validation will rejectundefined. This is more correct for client schemas where the server applies the default, but it's a behavioral change beyond what the changeset title describes.- Test infra refactoring — output dir changed from
.gen/snapshotsto.tmp, withglobalTeardown.tsfor cleanup and sharedconstants.ts. The root.gitignorealready covers.tmp, so the local.gitignorecleanup is safe.
Task list (4/4 completed)
- Read the diff: changeset, core walker changes, and test infrastructure
- Read snapshot changes to understand the behavioral impact
- Trace data flow in walker changes for correctness
- Self-critique and submit review
a798839 to
cda5297
Compare
|
@pullfrog happy with the latest changes? |
There was a problem hiding this comment.
Reviewed — no issues found.
Task list (5/5 completed)
- Checkout PR and read the diff
- Review walker changes (zod mini, v3, v4, valibot)
- Review test infrastructure changes
- Review snapshot changes
- Submit review

Closes #3751