Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
dapperdandev opened this issue Jun 3, 2021 · 2 comments · May be fixed by #69 or #84
Open

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

dapperdandev opened this issue Jun 3, 2021 · 2 comments · May be fixed by #69 or #84

Comments

@dapperdandev
Copy link
Contributor

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
Copy link
Owner

Sure, go on! 🚀

The more features this plugin wraps, the better!

@dapperdandev
Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants