close
Skip to content

Add ability to use z.discriminatedUnion and z.union in schemas - #432

Merged
jpwilliams merged 2 commits into
mainfrom
fix/zod-unions
Dec 15, 2023
Merged

jpwilliams merged 2 commits into
mainfrom
fix/zod-unions

Conversation

@jpwilliams

@jpwilliams jpwilliams commented Dec 15, 2023 •

Copy link
Copy Markdown
Member

Summary

Add the ability to use z.discriminatedUnion() and z.union() (as long as it's only a union of valid types).

Note that z.discriminatedUnion() will likely be deprecated in lieu of z.switch(), though this API is not yet available. See colinhacks/zod#2106.

Checklist

  • Added a docs PR that references this PR N/A
  • Added unit/integration tests
  • Added changesets if applicable

Related

@jpwilliams jpwilliams added the ⬆️ improvement Performance, reliability, or usability improvements label Dec 15, 2023
@jpwilliams jpwilliams self-assigned this Dec 15, 2023
@changeset-bot

changeset-bot Bot commented Dec 15, 2023 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: e14b054

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

This PR includes changesets to release 1 package
Name Type
inngest 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

@jpwilliams
jpwilliams merged commit ce354f3 into main Dec 15, 2023
@jpwilliams
jpwilliams deleted the fix/zod-unions branch December 15, 2023 17:14
jpwilliams pushed a commit that referenced this pull request Dec 15, 2023
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## inngest@3.7.3

### Patch Changes

- [#432](#432)
[`ce354f3`](ce354f3)
Thanks [@jpwilliams](https://github.com/jpwilliams)! - Add ability to
use `z.discriminatedUnion` and `z.union` in schemas

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

⬆️ improvement Performance, reliability, or usability improvements 📦 inngest Affects the `inngest` package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] z.discriminatedUnion should satisfy LiteralZodEventSchema

3 participants