Skip to content

Commit eb50fa4

Browse files
committed
[typescript-fetch] Fix map API return type
Fix APIs that return a map.
1 parent c35f32b commit eb50fa4

File tree

1 file changed

+5
-0
lines changed
  • modules/openapi-generator/src/main/resources/typescript-fetch

1 file changed

+5
-0
lines changed

modules/openapi-generator/src/main/resources/typescript-fetch/apis.mustache

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,12 @@ export class {{classname}} extends runtime.BaseAPI {
290290
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map({{returnBaseType}}FromJSON));
291291
{{/isListContainer}}
292292
{{^isListContainer}}
293+
{{#isMapContainer}}
294+
return new runtime.JSONApiResponse(response, (jsonValue) => runtime.mapValues(jsonValue, {{returnBaseType}}FromJSON));
295+
{{/isMapContainer}}
296+
{{^isMapContainer}}
293297
return new runtime.JSONApiResponse(response, (jsonValue) => {{returnBaseType}}FromJSON(jsonValue));
298+
{{/isMapContainer}}
294299
{{/isListContainer}}
295300
{{/returnTypeIsPrimitive}}
296301
{{/isResponseFile}}

0 commit comments

Comments
 (0)