middleware icon indicating copy to clipboard operation
middleware copied to clipboard

fix(zod-validator): the hook's return value is reflected in zValidator's return value

Open shoji9x9 opened this issue 2 months ago • 1 comments

Summary

Fixes an issue (#1550), that type inference fails to include the response from zValidator's hook.

The author should do the following, if applicable

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

Additional note

  • Ensures backward compatibility when hooks are not used
  • Modified to utilize overrides to ensure compatibility (could not be properly achieved with Conditional Types)

shoji9x9 avatar Nov 16 '25 07:11 shoji9x9

🦋 Changeset detected

Latest commit: c52373f263b7b4b3e49352f591d3c6d36d4a662e

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

This PR includes changesets to release 2 packages
Name Type
@hono/zod-validator Patch
@hono/zod-openapi Patch

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

changeset-bot[bot] avatar Nov 16 '25 07:11 changeset-bot[bot]

Codecov Report

:white_check_mark: All modified and coverable lines are covered by tests. :white_check_mark: Project coverage is 83.27%. Comparing base (5ede858) to head (c52373f). :warning: Report is 7 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1558      +/-   ##
==========================================
- Coverage   83.29%   83.27%   -0.02%     
==========================================
  Files         106      106              
  Lines        3419     3421       +2     
  Branches      877      877              
==========================================
+ Hits         2848     2849       +1     
- Misses        483      484       +1     
  Partials       88       88              
Flag Coverage Δ
zod-validator 0.61% <100.00%> (+0.01%) :arrow_up:

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

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

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

codecov[bot] avatar Nov 18 '25 06:11 codecov[bot]

Hi @shoji9x9

Awesome! The CI fails, but it's not related to this change. We can merge. Thank you for your first contribution!

yusukebe avatar Nov 19 '25 10:11 yusukebe

Thank you @shoji9x9 🙏

jraoult avatar Nov 19 '25 12:11 jraoult