Skip to content

feat(zod-openapi): support Zod v4#1223

Merged
yusukebe merged 6 commits intomainfrom
feat/zod-openapi-zod-4
Jul 18, 2025
Merged

feat(zod-openapi): support Zod v4#1223
yusukebe merged 6 commits intomainfrom
feat/zod-openapi-zod-4

Conversation

@yusukebe
Copy link
Copy Markdown
Member

@yusukebe yusukebe commented Jun 13, 2025

Fixes #1177

The author should do the following, if applicable

  • Add tests
  • Run tests
  • yarn changeset at the top of this repo and push the changeset
  • Follow the contribution guide

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Jun 13, 2025

🦋 Changeset detected

Latest commit: c5e711d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@hono/zod-openapi Major

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

type Expected = {
param: {
id: number
id: unknown
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The input type of coerce will be unknown in the v4:

https://zod.dev/v4/changelog#zcoerce-updates

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Jun 13, 2025

Codecov Report

❌ Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 59.02%. Comparing base (86a4ca4) to head (c5e711d).
⚠️ Report is 467 commits behind head on main.

Files with missing lines Patch % Lines
packages/zod-openapi/src/index.ts 50.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #1223       +/-   ##
===========================================
- Coverage   79.32%   59.02%   -20.31%     
===========================================
  Files          81      100       +19     
  Lines        2443     3268      +825     
  Branches      633      832      +199     
===========================================
- Hits         1938     1929        -9     
- Misses        419     1105      +686     
- Partials       86      234      +148     
Flag Coverage Δ
zod-openapi 3.70% <100.00%> (-1.33%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@yusukebe yusukebe force-pushed the feat/zod-openapi-zod-4 branch from 5e80bcf to bdd25f2 Compare June 13, 2025 20:37
@yusukebe yusukebe marked this pull request as draft June 13, 2025 20:43
@emersonlaurentino
Copy link
Copy Markdown

hey, @yusukebe are you still working on this? because there is a problem with drizzle drizzle-team/drizzle-orm#4249.

@yusukebe
Copy link
Copy Markdown
Member Author

Hey @emersonlaurentino

If version 8 of Zod to OpenAPI which supports Zod v4 has been released, we can release this.

Before that, please use the beta:

npm i @hono/zod-openapi@beta

@emersonlaurentino
Copy link
Copy Markdown

it's working for me, thanks!

@yusukebe yusukebe marked this pull request as ready for review July 18, 2025 07:39
@yusukebe yusukebe merged commit 845e336 into main Jul 18, 2025
4 of 5 checks passed
@yusukebe yusukebe deleted the feat/zod-openapi-zod-4 branch July 18, 2025 07:40
@github-actions github-actions bot mentioned this pull request Jul 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[@hono/zod-openapi] Supports Zod v4

3 participants