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

Open Zod to externally-defined combinators #307

Closed
carlpaten opened this issue Jan 29, 2021 · 2 comments
Closed

Open Zod to externally-defined combinators #307

carlpaten opened this issue Jan 29, 2021 · 2 comments

Comments

@carlpaten
Copy link
Collaborator

carlpaten commented Jan 29, 2021

To define a ZodTypeDef instance, one must pick a member of the enum ZodTypes. This is a problem for users wishing to define their own instances of ZodType, which requires a ZodTypeDef instance.

The solution is to factor the centralized aspects of Zod such that every combinator owns its error reporting, parsing logic, etc.

@carlpaten
Copy link
Collaborator Author

@colinhacks I'm not expecting you to implement this, but if you're open perhaps we could determine a process that would make you feel comfortable accepting PRs going in this direction.

@colinhacks
Copy link
Owner

Just released zod@3.0.0-alpha.7 which eliminates ZodTypes. Now any subclass of ZodType that properly implements the _parse method is a first-class citizen.

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

2 participants