java-to-zod
java-to-zod copied to clipboard
Support explicit zod types
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:
-
@ZodType("z.something()")
- This will still add any inferred attributes. In this way, extra attributes can still be added via@ZodType("z.something().moreAttrs()")
-
@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