diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/AbstractGenerator.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/AbstractGenerator.java index abf77b59cb1..234cdaeef45 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/AbstractGenerator.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/AbstractGenerator.java @@ -13,6 +13,7 @@ import java.io.Writer; import java.util.Scanner; import java.util.regex.Pattern; +import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -63,6 +64,10 @@ public abstract class AbstractGenerator { throw new RuntimeException("can't load template " + name); } + private String buildLibraryFilePath(String dir, String library, String file) { + return dir + File.separator + "libraries" + File.separator + library + File.separator + file; + } + /** * Get the template file path with template dir prepended, and use the * library template if exists. @@ -72,23 +77,38 @@ public abstract class AbstractGenerator { * @return String Full template file path */ public String getFullTemplateFile(CodegenConfig config, String templateFile) { - String template = config.templateDir() + File.separator + templateFile; + //1st the code will check if there's a