swagger-codegen icon indicating copy to clipboard operation
swagger-codegen copied to clipboard

[java] Resource structure customization for mustache template

Open sbelan opened this issue 10 years ago • 3 comments

Hi, I am using Swagger codegen 2.1.5 and generating client code for different languages. I am setting customized mustache from supporting file by extending swagger. As per my observationby default swagger looks for mustache template in resource/[language specific] folder. But if I change resource folder structure like resource/mustacheTemplates/[language specific] then it is failing to find the files. So to resolve this issues we required to override getFullTemplateFile method from DefaultGenerator to provide customized resource paths.

Is it possible to provide customized resource path from any additional property? It will save the efforts require to override getFullTemplateFile method.

sbelan avatar Feb 05 '16 11:02 sbelan

@wing328 Any more input require on this?

sbelan avatar Feb 17 '16 05:02 sbelan

Would -t command line option meet your need?

        -t <template directory>, --template-dir <template directory>
            folder containing the template files

wing328 avatar Feb 17 '16 06:02 wing328

@wing328 We are extended swagger and generating code using our java project. We are not using jar and command line tools. Is there any other way?

sbelan avatar Feb 17 '16 12:02 sbelan