Skip to content

fix(zod-validator): query input supports union / optional types#1634

Merged
yusukebe merged 3 commits into
mainfrom
fix/zod-validator-query-input-union-optional
Dec 18, 2025
Merged

fix(zod-validator): query input supports union / optional types#1634
yusukebe merged 3 commits into
mainfrom
fix/zod-validator-query-input-union-optional

Conversation

@yusukebe

Copy link
Copy Markdown
Member

Fixes honojs/hono#4584 honojs/hono#2481 (comment)

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

changeset-bot Bot commented Dec 18, 2025

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 4f9dbaf

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

@yusukebe yusukebe changed the title fix(zod-validator): query input supports union / optinal types fix(zod-validator): query input supports union / optional types Dec 18, 2025
@yusukebe yusukebe force-pushed the fix/zod-validator-query-input-union-optional branch from d605f28 to 452ee3b Compare December 18, 2025 08:30
@codecov

codecov Bot commented Dec 18, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.41%. Comparing base (c425848) to head (4f9dbaf).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1634   +/-   ##
=======================================
  Coverage   84.41%   84.41%           
=======================================
  Files         120      120           
  Lines        3894     3894           
  Branches     1052     1052           
=======================================
  Hits         3287     3287           
  Misses        516      516           
  Partials       91       91           
Flag Coverage Δ
zod-validator 0.54% <ø> (-0.01%) ⬇️

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.

@pkg-pr-new

pkg-pr-new Bot commented Dec 18, 2025

Copy link
Copy Markdown
@hono/ajv-validator

npm i https://pkg.pr.new/@hono/ajv-validator@1634

@hono/arktype-validator

npm i https://pkg.pr.new/@hono/arktype-validator@1634

@hono/auth-js

npm i https://pkg.pr.new/@hono/auth-js@1634

@hono/bun-compress

npm i https://pkg.pr.new/@hono/bun-compress@1634

@hono/bun-transpiler

npm i https://pkg.pr.new/@hono/bun-transpiler@1634

@hono/capnweb

npm i https://pkg.pr.new/@hono/capnweb@1634

@hono/casbin

npm i https://pkg.pr.new/@hono/casbin@1634

@hono/class-validator

npm i https://pkg.pr.new/@hono/class-validator@1634

@hono/clerk-auth

npm i https://pkg.pr.new/@hono/clerk-auth@1634

@hono/cloudflare-access

npm i https://pkg.pr.new/@hono/cloudflare-access@1634

@hono/conform-validator

npm i https://pkg.pr.new/@hono/conform-validator@1634

@hono/effect-validator

npm i https://pkg.pr.new/@hono/effect-validator@1634

@hono/esbuild-transpiler

npm i https://pkg.pr.new/@hono/esbuild-transpiler@1634

@hono/eslint-config

npm i https://pkg.pr.new/@hono/eslint-config@1634

@hono/event-emitter

npm i https://pkg.pr.new/@hono/event-emitter@1634

@hono/firebase-auth

npm i https://pkg.pr.new/@hono/firebase-auth@1634

@hono/graphql-server

npm i https://pkg.pr.new/@hono/graphql-server@1634

@hono/hello

npm i https://pkg.pr.new/@hono/hello@1634

@hono/mcp

npm i https://pkg.pr.new/@hono/mcp@1634

@hono/medley-router

npm i https://pkg.pr.new/@hono/medley-router@1634

@hono/node-ws

npm i https://pkg.pr.new/@hono/node-ws@1634

@hono/oauth-providers

npm i https://pkg.pr.new/@hono/oauth-providers@1634

@hono/oidc-auth

npm i https://pkg.pr.new/@hono/oidc-auth@1634

@hono/otel

npm i https://pkg.pr.new/@hono/otel@1634

@hono/prometheus

npm i https://pkg.pr.new/@hono/prometheus@1634

@hono/qwik-city

npm i https://pkg.pr.new/@hono/qwik-city@1634

@hono/react-compat

npm i https://pkg.pr.new/@hono/react-compat@1634

@hono/react-renderer

npm i https://pkg.pr.new/@hono/react-renderer@1634

@hono/sentry

npm i https://pkg.pr.new/@hono/sentry@1634

@hono/session

npm i https://pkg.pr.new/@hono/session@1634

@hono/ssg-plugins-essential

npm i https://pkg.pr.new/@hono/ssg-plugins-essential@1634

@hono/standard-validator

npm i https://pkg.pr.new/@hono/standard-validator@1634

@hono/stytch-auth

npm i https://pkg.pr.new/@hono/stytch-auth@1634

@hono/swagger-editor

npm i https://pkg.pr.new/@hono/swagger-editor@1634

@hono/swagger-ui

npm i https://pkg.pr.new/@hono/swagger-ui@1634

@hono/trpc-server

npm i https://pkg.pr.new/@hono/trpc-server@1634

@hono/tsyringe

npm i https://pkg.pr.new/@hono/tsyringe@1634

@hono/typebox-validator

npm i https://pkg.pr.new/@hono/typebox-validator@1634

@hono/typedriver-validator

npm i https://pkg.pr.new/@hono/typedriver-validator@1634

@hono/typia-validator

npm i https://pkg.pr.new/@hono/typia-validator@1634

@hono/ua-blocker

npm i https://pkg.pr.new/@hono/ua-blocker@1634

@hono/valibot-validator

npm i https://pkg.pr.new/@hono/valibot-validator@1634

@hono/zod-openapi

npm i https://pkg.pr.new/@hono/zod-openapi@1634

@hono/zod-validator

npm i https://pkg.pr.new/@hono/zod-validator@1634

commit: 4f9dbaf

@yusukebe yusukebe merged commit 77cfae9 into main Dec 18, 2025
94 checks passed
@yusukebe yusukebe deleted the fix/zod-validator-query-input-union-optional branch December 18, 2025 08:37
@github-actions github-actions Bot mentioned this pull request Dec 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

using .optional() on query param schema using zodValidator resolves enums to strings

1 participant