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

Embedded mustache files are used even if TemplateFolder option is specified and contains a different version of the mustache file (in a library folder) #4627

Closed
eblis opened this issue Jan 23, 2017 · 4 comments

Comments

@eblis
Copy link
Contributor

eblis commented Jan 23, 2017

Description

I'm trying to generate Spring-Boot server sources from a swagger.json file and I'm specifying my own TemplateFolder which was copied from the original JavaSpring template folder and subsequently modified. I've modified the pom.mustache file for all 3 Spring libraries (spring-boot, spring-cloud and spring-mvc) and none are taken into consideration while generating for spring-boot library.

Swagger-codegen version

2.2.2-SNAPSHOT

Command line used for generation

./java -jar swagger-codegen-cli.jar generate -i swagger.json -c spring-config.json -l spring -o samples/server/test -t JavaSpring-Modified

@eblis
Copy link
Contributor Author

eblis commented Jan 23, 2017

This seems to affect all languages that have libraries, not limited to Spring.

eblis added a commit to eblis/swagger-codegen that referenced this issue Jan 23, 2017
…ibraries subfolder of the supplied templateFolder, before checking the embedded locations.
@eblis eblis changed the title [SPRING] Default pom.mustache is used even if TemplateFolder option is specified and contains a different pom.mustache Embedded mustache files are used even if TemplateFolder option is specified and contains a different version of the mustache file (in a library folder) Jan 23, 2017
wing328 pushed a commit that referenced this issue Mar 20, 2017
* #4627 - When looking for template files also look in the libraries subfolder of the supplied templateFolder, before checking the embedded locations.

* Reworked the order in which template files are searched for:
 - 1st the code will check if there's a <template folder>/libraries/<library> folder containing the file
 - 2nd it will check for the file in the specified <template folder> folder
 - 3rd it will check if there's an <embedded template>/libraries/<library> folder containing the file
 - 4th and last it will assume the file is in <embedded template> folder.

 Added unit test to test template dir overloading.
spr3nk3ls pushed a commit to spr3nk3ls/swagger-codegen that referenced this issue Mar 28, 2017
…gger-api#4628)

* swagger-api#4627 - When looking for template files also look in the libraries subfolder of the supplied templateFolder, before checking the embedded locations.

* Reworked the order in which template files are searched for:
 - 1st the code will check if there's a <template folder>/libraries/<library> folder containing the file
 - 2nd it will check for the file in the specified <template folder> folder
 - 3rd it will check if there's an <embedded template>/libraries/<library> folder containing the file
 - 4th and last it will assume the file is in <embedded template> folder.

 Added unit test to test template dir overloading.
@anselmos
Copy link

@eblis any suggestion how to fix this issue - I'm currently trying to debug and hotfix this but no success so far...
Related issues : #9521 #9363

@eblis
Copy link
Contributor Author

eblis commented Aug 16, 2019

I haven't been following this for a while, but have you tried my changes that I made ? It worked for me at the time.

@HugoMario
Copy link
Contributor

this is fixed for codegen 2.x version, so closing now, but please, let me know if issue it's still present and i work on it asap.

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

No branches or pull requests

3 participants