diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptClientCodegen.java index d7e9613bf50..b9913272c08 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptClientCodegen.java @@ -124,6 +124,9 @@ public class TypeScriptClientCodegen extends DefaultCodegen implements CodegenCo supportingFiles.add(new SupportingFile("configuration.mustache", "", "configuration.ts")); supportingFiles.add(new SupportingFile("middleware.mustache", "", "middleware.ts")); + // models + this.modelPackage = ""; + this.modelTemplateFiles.put("models/models.mustache", ".ts"); } diff --git a/modules/openapi-generator/src/main/resources/typescript/licenseInfo.mustache b/modules/openapi-generator/src/main/resources/typescript/licenseInfo.mustache new file mode 100644 index 00000000000..e4d6f022577 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/typescript/licenseInfo.mustache @@ -0,0 +1,3 @@ +/* + TODO: LICENSE INFO +*/ \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/typescript/models/models.mustache b/modules/openapi-generator/src/main/resources/typescript/models/models.mustache new file mode 100644 index 00000000000..0eebdc9ceb7 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/typescript/models/models.mustache @@ -0,0 +1,15 @@ +// tslint:disable +{{>licenseInfo}} +{{#models}} +{{#model}} +{{#imports}} +import { {{.}} } from './{{.}}'; +{{/imports}} +{{#isEnum}} +{{>models/modelEnum}} +{{/isEnum}} +{{^isEnum}} +{{>models/modelGeneric}} +{{/isEnum}} +{{/model}} +{{/models}} \ No newline at end of file