diff --git a/src/main/java/io/swagger/codegen/v3/generators/kotlin/AbstractKotlinCodegen.java b/src/main/java/io/swagger/codegen/v3/generators/kotlin/AbstractKotlinCodegen.java index fb5937edef..f37df9ccb1 100644 --- a/src/main/java/io/swagger/codegen/v3/generators/kotlin/AbstractKotlinCodegen.java +++ b/src/main/java/io/swagger/codegen/v3/generators/kotlin/AbstractKotlinCodegen.java @@ -11,6 +11,8 @@ import io.swagger.v3.oas.models.media.Schema; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import com.github.jknack.handlebars.helper.StringHelpers; +import com.github.jknack.handlebars.Handlebars; import java.io.File; import java.util.Arrays; @@ -506,6 +508,12 @@ public String toVarName(String name) { return super.toVarName(sanitizeKotlinSpecificNames(name)); } + @Override + public void addHandlebarHelpers(Handlebars handlebars) { + super.addHandlebarHelpers(handlebars); + handlebars.registerHelpers(StringHelpers.class); + } + /** * Provides a strongly typed declaration for simple arrays of some type and arrays of arrays of some type. * diff --git a/src/main/java/io/swagger/codegen/v3/generators/kotlin/KotlinServerCodegen.java b/src/main/java/io/swagger/codegen/v3/generators/kotlin/KotlinServerCodegen.java index 414166b90c..7d8800b51e 100644 --- a/src/main/java/io/swagger/codegen/v3/generators/kotlin/KotlinServerCodegen.java +++ b/src/main/java/io/swagger/codegen/v3/generators/kotlin/KotlinServerCodegen.java @@ -18,8 +18,6 @@ import java.util.Arrays; import java.util.List; import java.util.Map; -import com.github.jknack.handlebars.helper.StringHelpers; -import com.github.jknack.handlebars.Handlebars; import org.apache.commons.lang3.StringUtils; import static java.util.Collections.singletonMap; @@ -228,12 +226,6 @@ public void processOpts() { supportingFiles.add(new SupportingFile("ApiKeyAuth.kt.mustache", infrastructureFolder, "ApiKeyAuth.kt")); } - @Override - public void addHandlebarHelpers(Handlebars handlebars) { - super.addHandlebarHelpers(handlebars); - handlebars.registerHelpers(StringHelpers.class); - } - @Override public String getDefaultTemplateDir() { return "kotlin-server";