From 39a9c5587fd2a83f33b15dba14539e7b6648713b Mon Sep 17 00:00:00 2001 From: Keni Steward Date: Mon, 6 Nov 2017 12:19:58 -0500 Subject: [PATCH] [Typescript][Node] Fixes inccorect enum generation for enumsMap when Array is defined fixes part of Issue #5681 (#6862) --- .../src/main/resources/typescript-node/api.mustache | 2 +- samples/client/petstore/typescript-node/default/api.ts | 4 ++-- samples/client/petstore/typescript-node/npm/api.ts | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/typescript-node/api.mustache b/modules/swagger-codegen/src/main/resources/typescript-node/api.mustache index 81661719588..97e14dfc41a 100644 --- a/modules/swagger-codegen/src/main/resources/typescript-node/api.mustache +++ b/modules/swagger-codegen/src/main/resources/typescript-node/api.mustache @@ -196,7 +196,7 @@ let enumsMap = { {{#hasEnums}} {{#vars}} {{#isEnum}} - "{{datatypeWithEnum}}": {{datatypeWithEnum}}, + {{#isContainer}}"{{classname}}.{{enumName}}": {{classname}}.{{enumName}}{{/isContainer}}{{#isNotContainer}}"{{datatypeWithEnum}}": {{datatypeWithEnum}}{{/isNotContainer}}, {{/isEnum}} {{/vars}} {{/hasEnums}} diff --git a/samples/client/petstore/typescript-node/default/api.ts b/samples/client/petstore/typescript-node/default/api.ts index 2f5dd35c4f1..6ee6f176454 100644 --- a/samples/client/petstore/typescript-node/default/api.ts +++ b/samples/client/petstore/typescript-node/default/api.ts @@ -407,8 +407,8 @@ export class User { let enumsMap = { - "Order.StatusEnum": Order.StatusEnum, - "Pet.StatusEnum": Pet.StatusEnum, + "Order.StatusEnum": Order.StatusEnum, + "Pet.StatusEnum": Pet.StatusEnum, } let typeMap = { diff --git a/samples/client/petstore/typescript-node/npm/api.ts b/samples/client/petstore/typescript-node/npm/api.ts index 2f5dd35c4f1..6ee6f176454 100644 --- a/samples/client/petstore/typescript-node/npm/api.ts +++ b/samples/client/petstore/typescript-node/npm/api.ts @@ -407,8 +407,8 @@ export class User { let enumsMap = { - "Order.StatusEnum": Order.StatusEnum, - "Pet.StatusEnum": Pet.StatusEnum, + "Order.StatusEnum": Order.StatusEnum, + "Pet.StatusEnum": Pet.StatusEnum, } let typeMap = {