Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(zod): strict true when using a discriminator #1923

Merged

Conversation

Georgegriff
Copy link
Contributor

@Georgegriff Georgegriff commented Feb 21, 2025

Status

READY

Description

Fix #1907 (comment) where strict() did not work correctly with discrinimatedUnions in zod due to how schemas were being merged

Related PRs

List related PRs against other branches:

branch PR
other_pr_master link

Todos

  • Tests
  • Documentation
  • Changelog Entry (unreleased)

Steps to Test or Reproduce

Before:

Run from the samples/hono/hono-with-zod

npm run generate-api
  1. See invalid typescript code

After

  1. Repeat the same
  2. See the new unit test for this case

@Georgegriff Georgegriff marked this pull request as ready for review February 21, 2025 12:55
@melloware melloware merged commit 3830a38 into orval-labs:master Feb 21, 2025
2 checks passed
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.

2 participants