Open kornysietsma opened 6 months ago
you can use a custom template for that https://github.com/astahmer/openapi-zod-client?tab=readme-ov-file#customization
Hmm - I'm not sure I can see how to do that. I could change the schema names in handlebars, by registering a helper function to rename the keys, something like
{{#each schemas}}
const {{#lowerCamel}}{{@key}}{{/lowerCamel}} = {{{this}}};
{{/each}}
but that wouldn't help where the {{{this}}}
part of the schema referes to other schemas.
Anyway from looking through the openapi-zod-client it looks like it'd be fiddly; we can probably get by with a bit of post-generation conversion.
Hi - we have a preferred convention of using lower case first letters for Zod schema, and keeping upper case for types:
Is there a way to generate code with these kinds of names?