From 7599531960a873022c78a998b2eea8749865fb4e Mon Sep 17 00:00:00 2001 From: Liam Martens Date: Mon, 20 Jan 2020 16:59:16 +0100 Subject: [PATCH] Fixed call of toISOString on a string type when using string type-mapping (#5057) --- .../src/main/resources/typescript-axios/apiInner.mustache | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/resources/typescript-axios/apiInner.mustache b/modules/openapi-generator/src/main/resources/typescript-axios/apiInner.mustache index 3f625aca23de..dc839d57cf7b 100644 --- a/modules/openapi-generator/src/main/resources/typescript-axios/apiInner.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-axios/apiInner.mustache @@ -115,7 +115,9 @@ export const {{classname}}AxiosParamCreator = function (configuration?: Configur {{^isListContainer}} if ({{paramName}} !== undefined) { {{#isDateTime}} - localVarQueryParameter['{{baseName}}'] = ({{paramName}} as any).toISOString(); + localVarQueryParameter['{{baseName}}'] = ({{paramName}} as any instanceof Date) ? + ({{paramName}} as any).toISOString() : + {{paramName}}; {{/isDateTime}} {{^isDateTime}} {{#isDate}}