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

Fixed DefaultGenerator.getHandleBars to not use a regex string for the templateDir #8246

Merged
merged 1 commit into from
Jun 7, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fixed getHandleBars to not use a regex string for the templateDir (in
Windows) path delimiters `\` would be interpreted as escape sequences.

replaced `replaceFirest()` with `StringUtils.replaceOnce()`

This fixes #8245
  • Loading branch information
Thomas Baker committed May 29, 2018
commit 7ee934cfcd1eb75c3d720c5782e9780c6d821d72
Original file line number Diff line number Diff line change
Expand Up @@ -1011,7 +1011,7 @@ private Map<String, SecurityScheme> getAuthMethods(List<SecurityRequirement> sec

private com.github.jknack.handlebars.Template getHandlebars(String templateFile) throws IOException {
if (templateFile.startsWith(config.templateDir())) {
templateFile = templateFile.replaceFirst(config.templateDir(), StringUtils.EMPTY);
templateFile = StringUtils.replaceOnce(templateFile, config.templateDir(), StringUtils.EMPTY);
}
TemplateLoader templateLoader = null;
if (config.additionalProperties().get(CodegenConstants.TEMPLATE_DIR) != null) {
Expand Down