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

Can't get Templates to work #7450

Open
AndyMedtronic opened this issue Sep 18, 2020 · 2 comments
Open

Can't get Templates to work #7450

AndyMedtronic opened this issue Sep 18, 2020 · 2 comments

Comments

@AndyMedtronic
Copy link

I think this is more of a problem with documentation or my stupidity, and I apologize if this has been answered before, (but my search didn't reveal an easy answer) but I can't get Templates noticed with my AspNetCore project

I installed OpenApi-generator with NPM and I can see the openapi-generator jar file in C:\Users\robera22\AppData\Roaming\npm\node_modules@openapitools\openapi-generator-cli\bin.

If I make changes to this (WinZip, don't unpack, change e.g. aspnetcore/3.0/Controller.mustache, save mustache, save zip) then generation works with my command line and I can see the changes I have made.

openapi-generator generate ^
-i Planning\OpenApi\ToolboxV3\MmtBatchWizard.v1.yaml ^
-g aspnetcore ^
-o Servers\v30Local4 ^
-t Servers\Templates ^
--additional-properties=^
aspnetCoreVersion=3.0,^
operationIsAsync=true,^
packageName=Medtronic.Toolbox.MmtBatchWizard,^
packageTitle=MedtronicToolboxSandbox,^
packageVersion=3.0

However this is horribly cumbersome, and takes forever to re-jar the large openapi-generator file

The documentation suggests that I should be able to specify single templates so I set up a Template folder.

First I placed a single amended Mustache File in there (Controller.mustache), no effect
Then I copied the whole aspnetcore/3.0 folder there
Then the aspnetcore
Then the openapi-generator folder
Then the openapi-generator.jar file

None of these had any effect. Still picking up the amendments in the npm/@OpenAPITools

What am I doing wrong in what should be a very simple use case

@auto-labeler
Copy link

auto-labeler bot commented Sep 18, 2020

👍 Thanks for opening this issue!
🏷 I have applied any labels matching special text in your issue.

The team will review the labels and make any necessary changes.

@jimschubert
Copy link
Member

@AndyMedtronic you're likely being bitten by case-sensitivity issues. If you create a directory called Templates and you're using aspnetcore 3.0, you'd create Templates\3.0\controller.mustache. When you run, you point to Templates as you've shown in your example.

We do sometimes have issues with Windows paths. If possible, please try in gitbash or other terminal with Linux style file separators. I've recently fixed an issue with Windows file separators in master which will be included in the 5.0.0 release.

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

No branches or pull requests

2 participants