openapi-ts
openapi-ts copied to clipboard
Zod Coerce all/certain types
Description
Allow the generated code to coerce certain types (number for example). Right now the generation is pretty static and do not allow small configuration change.
Also can the zod generated schemas be added to the generated index.ts for easier imports?
@juggy
Allow the generated code to coerce certain types (number for example).
Do you have an example of what you're trying to generate?
Also can the zod generated schemas be added to the generated index.ts for easier imports?
Some common example are:
- non empty string
string().min(1) - non iso date
iso.date()->date() - change all the numbers to coerce strings
I can refine on a usage basis, but that would be nice to allow to change the generation with some defaults.