From 00ffcea6ef13a89d49ce3f4bb768e3a2e8df8dfb Mon Sep 17 00:00:00 2001 From: Harald Fernengel Date: Wed, 22 Apr 2020 14:25:26 +0200 Subject: [PATCH] [typescript-fetch] Fix map API return type (#5995) Fix APIs that return a map. --- .../src/main/resources/typescript-fetch/apis.mustache | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/openapi-generator/src/main/resources/typescript-fetch/apis.mustache b/modules/openapi-generator/src/main/resources/typescript-fetch/apis.mustache index 881f1b7ab52..ace07d5b962 100644 --- a/modules/openapi-generator/src/main/resources/typescript-fetch/apis.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-fetch/apis.mustache @@ -290,7 +290,12 @@ export class {{classname}} extends runtime.BaseAPI { return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map({{returnBaseType}}FromJSON)); {{/isListContainer}} {{^isListContainer}} + {{#isMapContainer}} + return new runtime.JSONApiResponse(response, (jsonValue) => runtime.mapValues(jsonValue, {{returnBaseType}}FromJSON)); + {{/isMapContainer}} + {{^isMapContainer}} return new runtime.JSONApiResponse(response, (jsonValue) => {{returnBaseType}}FromJSON(jsonValue)); + {{/isMapContainer}} {{/isListContainer}} {{/returnTypeIsPrimitive}} {{/isResponseFile}}