From c08900cda69573544e3259f3967f3c7cc3f6e887 Mon Sep 17 00:00:00 2001 From: tanmen Date: Thu, 28 Nov 2019 15:54:17 +0900 Subject: [PATCH] fix unused import if allOf --- .../resources/typescript-rxjs/modelAllOf.mustache | 14 ++++++++++++++ .../main/resources/typescript-rxjs/models.mustache | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 modules/openapi-generator/src/main/resources/typescript-rxjs/modelAllOf.mustache diff --git a/modules/openapi-generator/src/main/resources/typescript-rxjs/modelAllOf.mustache b/modules/openapi-generator/src/main/resources/typescript-rxjs/modelAllOf.mustache new file mode 100644 index 000000000000..2c4f686eacb9 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/typescript-rxjs/modelAllOf.mustache @@ -0,0 +1,14 @@ +{{#hasImports}} +import { + {{#imports}} + {{{.}}}, + {{/imports}} +} from './'; + +{{/hasImports}} +/** + * @type {{classname}}{{#description}} + * {{{description}}}{{/description}} + * @export + */ +export type {{classname}} = {{#allOf}}{{{.}}}{{^-last}} & {{/-last}}{{/allOf}}; \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/typescript-rxjs/models.mustache b/modules/openapi-generator/src/main/resources/typescript-rxjs/models.mustache index ae5738af9846..6f5fe539ee41 100644 --- a/modules/openapi-generator/src/main/resources/typescript-rxjs/models.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-rxjs/models.mustache @@ -2,6 +2,6 @@ {{>licenseInfo}} {{#models}} {{#model}} -{{#isEnum}}{{>modelEnum}}{{/isEnum}}{{#oneOf}}{{#-first}}{{>modelOneOf}}{{/-first}}{{/oneOf}}{{^isEnum}}{{^oneOf}}{{>modelGeneric}}{{/oneOf}}{{/isEnum}} +{{#isEnum}}{{>modelEnum}}{{/isEnum}}{{#oneOf}}{{#-first}}{{>modelOneOf}}{{/-first}}{{/oneOf}}{{#allOf}}{{#-first}}{{>modelAllOf}}{{/-first}}{{/allOf}}{{^isEnum}}{{^oneOf}}{{^allOf}}{{>modelGeneric}}{{/allOf}}{{/oneOf}}{{/isEnum}} {{/model}} {{/models}}