java-to-zod icon indicating copy to clipboard operation
java-to-zod copied to clipboard

Support explicit zod types

Open ivangreene opened this issue 10 months ago • 0 comments

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

ivangreene avatar Apr 07 '24 16:04 ivangreene