Skip to content

Conversation

@AlexZasorin
Copy link

@AlexZasorin AlexZasorin commented Jan 18, 2026

This PR introduces support for the @OneOf directive as documented in #1262 for zod and zodv4 schemas.

yup and myzod don't have a never equivalent, so validation must be implemented using a custom validator. I gave it a shot, but ultimately I didn't feel like trying to dive into yup, myzod, and valibot. I feel that support for zod/zodv4 is already pretty valuable and might be worth merging. I may eventually come back to support the rest, and obviously others are free to do the same based on the changes in this PR.

Needed to downgrade vitest due to test failures with Vite v4.

  • fix(deps): downgrade vitest to allow tests to pass
  • feat(zod): oneOf directive handling
  • feat(zodv4): oneOf schema handling
  • chore: update examples to include @OneOf

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.

1 participant