trumbitta / nx-trumbitta

💡An attempt to start collecting all of my Nx-related Open Source work in a mono-repo.
MIT License
47 stars 11 forks source link

Feature Request: Add support for -t/--template #30

Open dapperdandev opened 3 years ago

dapperdandev commented 3 years ago

When using opencli-generator-cli manually, I'm able to pass a flag to specify a folder that contains template overrides. I'd love to have this available in this tool.

In my case, I'm using typescript-angular and the default api.service.mustache template adds a lot of bloat I don't want. I copied the .mustache file from https://github.com/OpenAPITools/openapi-generator/tree/master/modules/openapi-generator/src/main/resources/typescript-angular, modified it to my liking, then added it to a folder in my project named custom. This allows me to run: openapi-generator generate -i spec.yaml -g typescript-angular -t ./custom/ -o ./output/

The tool is smart enough to use custom templates if available, and use the default generator's templates otherwise.

https://openapi-generator.tech/docs/templating#modifying-templates

I'm happy to build this feature if you find it useful. :)

trumbitta commented 3 years ago

Sure, go on! 🚀

The more features this plugin wraps, the better!

dapperdandev commented 3 years ago

Awesome! I'm pretty swamped between work and school at the moment, so it might be a couple of months, but I'll build this out once things slow down a little.