File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
templates-v7/typescript/api Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ export class {{classname}} extends Service {
40
40
const endpoint = `${this.baseUrl} { {{path} }}`{ {#pathParams} }
41
41
.replace("{ " + " {{baseName} }" + "}", encodeURIComponent(String({ {paramName} }))){ {/pathParams} };
42
42
const resource = new Resource(this, endpoint);
43
+
43
44
{ {#bodyParam} }
44
45
const request: { {{dataType} }} = ObjectSerializer.serialize({ {paramName} }, "{ {{dataType} }}", "");
45
46
{ {/bodyParam} }
@@ -53,14 +54,15 @@ export class {{classname}} extends Service {
53
54
{ {/queryParams} }
54
55
}
55
56
{ {/hasQueryParams} }
56
- { {#hasProduces } }const response = { {/hasProduces } }await getJsonResponse<{ {#bodyParam} }{ {{dataType} }}{ {/bodyParam} }{ {^bodyParam} }string{ {/bodyParam} }, { {#returnType} }{ {{.} }}{ {/returnType} }{ {^returnType} }void{ {/returnType} }>(
57
+ { {#returnProperty } }const response = { {/returnProperty } }await getJsonResponse<{ {#bodyParam} }{ {{dataType} }}{ {/bodyParam} }{ {^bodyParam} }string{ {/bodyParam} }, { {#returnType} }{ {{.} }}{ {/returnType} }{ {^returnType} }void{ {/returnType} }>(
57
58
resource,
58
59
{ {#bodyParam} }request{ {/bodyParam} }{ {^bodyParam} }""{ {/bodyParam} },
59
60
{ ...requestOptions, method: " {{httpMethod}}" }
60
61
);
61
- { {#hasProduces} }
62
+ { {#returnProperty} }
63
+
62
64
return ObjectSerializer.deserialize(response, "{ {{returnType} }}", "");
63
- { {/hasProduces } }
65
+ { {/returnProperty } }
64
66
}
65
67
66
68
{ {/operation} }
You can’t perform that action at this time.
0 commit comments