diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java index c91f93e5ef93..9f44dd64cec6 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java @@ -29,9 +29,7 @@ import java.text.SimpleDateFormat; import java.util.*; -import static org.openapitools.codegen.utils.StringUtils.camelize; -import static org.openapitools.codegen.utils.StringUtils.underscore; -import static org.openapitools.codegen.utils.StringUtils.dashize; +import static org.openapitools.codegen.utils.StringUtils.*; public class TypeScriptAngularClientCodegen extends AbstractTypeScriptClientCodegen { private static final Logger LOGGER = LoggerFactory.getLogger(TypeScriptAngularClientCodegen.class); @@ -529,7 +527,7 @@ public String toApiImport(String name) { @Override public String toModelFilename(String name) { - return this.convertUsingFileNamingConvention(this.sanitizeName(name) + modelFileSuffix); + return this.convertUsingFileNamingConvention(this.sanitizeName(name)) + modelFileSuffix; } @Override diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptangular/TypeScriptAngularClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptangular/TypeScriptAngularClientCodegenTest.java new file mode 100644 index 000000000000..00025c5fe512 --- /dev/null +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptangular/TypeScriptAngularClientCodegenTest.java @@ -0,0 +1,17 @@ +package org.openapitools.codegen.typescript.typescriptangular; + +import org.junit.Assert; +import org.junit.Test; +import org.openapitools.codegen.languages.TypeScriptAngularClientCodegen; + +public class TypeScriptAngularClientCodegenTest { + @Test + public void testModelFileSuffix() { + TypeScriptAngularClientCodegen codegen = new TypeScriptAngularClientCodegen(); + codegen.additionalProperties().put("modelFileSuffix", "MySuffix"); + codegen.additionalProperties().put("modelSuffix", "MySuffix"); + codegen.processOpts(); + + Assert.assertEquals(codegen.toModelFilename("testName"), "testNameMySuffix"); + } +}