forked from loafle/openapi-generator-original
Added model generation with imports
This commit is contained in:
parent
6638cef37a
commit
1a31c48ceb
@ -124,6 +124,9 @@ public class TypeScriptClientCodegen extends DefaultCodegen implements CodegenCo
|
|||||||
supportingFiles.add(new SupportingFile("configuration.mustache", "", "configuration.ts"));
|
supportingFiles.add(new SupportingFile("configuration.mustache", "", "configuration.ts"));
|
||||||
supportingFiles.add(new SupportingFile("middleware.mustache", "", "middleware.ts"));
|
supportingFiles.add(new SupportingFile("middleware.mustache", "", "middleware.ts"));
|
||||||
|
|
||||||
|
// models
|
||||||
|
this.modelPackage = "";
|
||||||
|
this.modelTemplateFiles.put("models/models.mustache", ".ts");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
3
modules/openapi-generator/src/main/resources/typescript/licenseInfo.mustache
vendored
Normal file
3
modules/openapi-generator/src/main/resources/typescript/licenseInfo.mustache
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
/*
|
||||||
|
TODO: LICENSE INFO
|
||||||
|
*/
|
15
modules/openapi-generator/src/main/resources/typescript/models/models.mustache
vendored
Normal file
15
modules/openapi-generator/src/main/resources/typescript/models/models.mustache
vendored
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
// tslint:disable
|
||||||
|
{{>licenseInfo}}
|
||||||
|
{{#models}}
|
||||||
|
{{#model}}
|
||||||
|
{{#imports}}
|
||||||
|
import { {{.}} } from './{{.}}';
|
||||||
|
{{/imports}}
|
||||||
|
{{#isEnum}}
|
||||||
|
{{>models/modelEnum}}
|
||||||
|
{{/isEnum}}
|
||||||
|
{{^isEnum}}
|
||||||
|
{{>models/modelGeneric}}
|
||||||
|
{{/isEnum}}
|
||||||
|
{{/model}}
|
||||||
|
{{/models}}
|
Loading…
x
Reference in New Issue
Block a user