Skip to content

Commit a9dba40

Browse files
committed
update return types to handle uniqueItems
1 parent 7498893 commit a9dba40

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

templatesOas/apis.endpoint.mustache

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
{{/hasFormParams}}
3434
{{/hasBodyParam}}
3535
*
36-
* @returns A promise of type {{{returnType}}}{{^returnType}}void{{/returnType}}.
36+
* @returns A promise of type {{#returnType}}{{#isArray}}Array<{{returnBaseType}}>{{/isArray}}{{^isArray}}{{{returnType}}}{{/isArray}}{{/returnType}}{{^returnType}}void{{/returnType}}.
3737
*/
3838
{{nickname}}(
3939
options{{^hasBodyParam}}?{{/hasBodyParam}}: RequireParametersUnlessAllAreOptional<{
@@ -77,7 +77,7 @@
7777
{{/hasFormParams}}
7878
{{/hasBodyParam}}
7979
}>
80-
): Promise<{{{returnType}}}{{^returnType}}void{{/returnType}}>;
80+
): Promise<{{#returnType}}{{#isArray}}Array<{{returnBaseType}}>{{/isArray}}{{^isArray}}{{{returnType}}}{{/isArray}}{{/returnType}}{{^returnType}}void{{/returnType}}>;
8181

8282
/**
8383
* {{{unescapedNotes}}}
@@ -111,7 +111,7 @@
111111
{{/hasBodyParam}}
112112
* @param rawResponse - Set to true to return entire Response object instead of DTO.
113113
*
114-
* @returns A promise of type Response if rawResponse is true, a promise of type {{{returnType}}}{{^returnType}}void{{/returnType}} otherwise.
114+
* @returns A promise of type Response if rawResponse is true, a promise of type {{#returnType}}{{#isArray}}Array<{{returnBaseType}}>{{/isArray}}{{^isArray}}{{{returnType}}}{{/isArray}}{{/returnType}}{{^returnType}}void{{/returnType}} otherwise.
115115
*/
116116
{{nickname}}<T extends boolean>(
117117
options{{^hasBodyParam}}?{{/hasBodyParam}}: RequireParametersUnlessAllAreOptional<{
@@ -156,7 +156,7 @@
156156
{{/hasBodyParam}}
157157
}>,
158158
rawResponse?: T
159-
): Promise<T extends true ? Response : {{{returnType}}}{{^returnType}}void{{/returnType}}>;
159+
): Promise<T extends true ? Response : {{#returnType}}{{#isArray}}Array<{{returnBaseType}}>{{/isArray}}{{^isArray}}{{{returnType}}}{{/isArray}}{{/returnType}}{{^returnType}}void{{/returnType}}>;
160160

161161
/**
162162
* {{{unescapedNotes}}}
@@ -190,7 +190,7 @@
190190
{{/hasBodyParam}}
191191
* @param rawResponse - Set to true to return entire Response object instead of DTO.
192192
*
193-
* @returns A promise of type Response if rawResponse is true, a promise of type {{{returnType}}}{{^returnType}}void{{/returnType}} otherwise.
193+
* @returns A promise of type Response if rawResponse is true, a promise of type {{#returnType}}{{#isArray}}Array<{{returnBaseType}}>{{/isArray}}{{^isArray}}{{{returnType}}}{{/isArray}}{{/returnType}}{{^returnType}}void{{/returnType}} otherwise.
194194
*/
195195
async {{nickname}}(
196196
options{{^hasBodyParam}}?{{/hasBodyParam}}: RequireParametersUnlessAllAreOptional<{
@@ -235,7 +235,7 @@
235235
{{/hasBodyParam}}
236236
}>,
237237
rawResponse?: boolean
238-
): Promise<Response | {{{returnType}}}{{^returnType}}void{{/returnType}}> {
238+
): Promise<Response | {{#returnType}}{{#isArray}}Array<{{returnBaseType}}>{{/isArray}}{{^isArray}}{{{returnType}}}{{/isArray}}{{/returnType}}{{^returnType}}void{{/returnType}}> {
239239
const optionParams = options?.parameters || ({} as Partial<NonNullable<NonNullable<typeof options>["parameters"]>>);
240240
const configParams = this.clientConfig.parameters as CommonParameters;
241241

0 commit comments

Comments
 (0)