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

ZOD enums support #289

Open
2 tasks done
reapziq opened this issue May 31, 2024 · 0 comments
Open
2 tasks done

ZOD enums support #289

reapziq opened this issue May 31, 2024 · 0 comments

Comments

@reapziq
Copy link

reapziq commented May 31, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Feature Request

Whenever I need to validate that a queried string is of an allowed set of values, I currently use a combination of q.union and q.literal, e.g. q.union([q.literal('exact'), q.literal('approximate')]).
The query itself is (as expected) not affected by this, so it's just about narrowing the queried type.
Would it be complicated to add native support for ZOD enums similarly to literal, or am I missing a way to chain q calls with z validators to narrow down the queried type?
Thank you!

@reapziq reapziq changed the title Support ZOD enums ZOD enums support May 31, 2024
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

No branches or pull requests

1 participant