[typescript-fetch] Fix map API return type (#5995)

Fix APIs that return a map.
This commit is contained in:
Harald Fernengel 2020-04-22 14:25:26 +02:00 committed by GitHub
parent b431d65099
commit 00ffcea6ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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}}