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

Support explicit zod types #35

Open
ivangreene opened this issue Apr 7, 2024 · 0 comments
Open

Support explicit zod types #35

ivangreene opened this issue Apr 7, 2024 · 0 comments

Comments

@ivangreene
Copy link
Owner

It makes sense to just support breaking out of the type inference in two basic ways, for types that are not yet supported or for custom extension. I'm imagining this as two separate annotations:

  1. @ZodType("z.something()") - This will still add any inferred attributes. In this way, extra attributes can still be added via @ZodType("z.something().moreAttrs()")
  2. @ZodAttributes({"nullable()", "somethingElse()"}) - This will get rid of any inferred attributes. Or perhaps with an option to include other attributes or not

That way, the two annotations can be used alone or together depending on the use case

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