@@ -98,49 +98,49 @@ export const {{classname}}FetchParamCreator = function (configuration?: Configur
98
98
}
99
99
{{/required}}
100
100
{{/allParams}}
101
- const path = `{{{path}}}`{{#pathParams}}
101
+ const localVarPath = `{{{path}}}`{{#pathParams}}
102
102
.replace(`{${"{{baseName}}"}}`, encodeURIComponent(String({{paramName}}))){{/pathParams}};
103
- const urlObj = url.parse(path , true);
104
- const requestOptions = Object.assign({ method: '{{httpMethod}}' }, options);
105
- const headerParameter = {} as any;
106
- const queryParameter = {} as any;
103
+ const localVarUrlObj = url.parse(localVarPath , true);
104
+ const localVarRequestOptions = Object.assign({ method: '{{httpMethod}}' }, options);
105
+ const localVarHeaderParameter = {} as any;
106
+ const localVarQueryParameter = {} as any;
107
107
{{#hasFormParams}}
108
- const formParams = new url.URLSearchParams();
108
+ const localVarFormParams = new url.URLSearchParams();
109
109
{{/hasFormParams}}
110
110
111
111
{{#authMethods}}
112
112
// authentication {{name}} required
113
113
{{#isApiKey}}
114
114
{{#isKeyInHeader}}
115
115
if (configuration && configuration.apiKey) {
116
- const apiKeyValue = typeof configuration.apiKey === 'function'
116
+ const localVarApiKeyValue = typeof configuration.apiKey === 'function'
117
117
? configuration.apiKey("{{keyParamName}}")
118
118
: configuration.apiKey;
119
- headerParameter ["{{keyParamName}}"] = apiKeyValue ;
119
+ localVarHeaderParameter ["{{keyParamName}}"] = localVarApiKeyValue ;
120
120
}
121
121
{{/isKeyInHeader}}
122
122
{{#isKeyInQuery}}
123
123
if (configuration && configuration.apiKey) {
124
- const apiKeyValue = typeof configuration.apiKey === 'function'
124
+ const localVarApiKeyValue = typeof configuration.apiKey === 'function'
125
125
? configuration.apiKey("{{keyParamName}}")
126
126
: configuration.apiKey;
127
- queryParameter ["{{keyParamName}}"] = apiKeyValue ;
127
+ localVarQueryParameter ["{{keyParamName}}"] = localVarApiKeyValue ;
128
128
}
129
129
{{/isKeyInQuery}}
130
130
{{/isApiKey}}
131
131
{{#isBasic}}
132
132
// http basic authentication required
133
133
if (configuration && (configuration.username || configuration.password)) {
134
- headerParameter ["Authorization"] = "Basic " + btoa(configuration.username + ":" + configuration.password);
134
+ localVarHeaderParameter ["Authorization"] = "Basic " + btoa(configuration.username + ":" + configuration.password);
135
135
}
136
136
{{/isBasic}}
137
137
{{#isOAuth}}
138
138
// oauth required
139
139
if (configuration && configuration.accessToken) {
140
- const accessTokenValue = typeof configuration.accessToken === 'function'
140
+ const localVarAccessTokenValue = typeof configuration.accessToken === 'function'
141
141
? configuration.accessToken("{{name}}", [{{#scopes}}"{{{scope}}}"{{^-last}}, {{/-last}}{{/scopes}}])
142
142
: configuration.accessToken;
143
- headerParameter ["Authorization"] = "Bearer " + accessTokenValue ;
143
+ localVarHeaderParameter ["Authorization"] = "Bearer " + localVarAccessTokenValue ;
144
144
}
145
145
{{/isOAuth}}
146
146
@@ -149,24 +149,24 @@ export const {{classname}}FetchParamCreator = function (configuration?: Configur
149
149
{{#isListContainer}}
150
150
if ({{paramName}}) {
151
151
{{#isCollectionFormatMulti}}
152
- queryParameter ['{{baseName}}'] = {{paramName}};
152
+ localVarQueryParameter ['{{baseName}}'] = {{paramName}};
153
153
{{/isCollectionFormatMulti}}
154
154
{{^isCollectionFormatMulti}}
155
- queryParameter ['{{baseName}}'] = {{paramName}}.join(COLLECTION_FORMATS["{{collectionFormat}}"]);
155
+ localVarQueryParameter ['{{baseName}}'] = {{paramName}}.join(COLLECTION_FORMATS["{{collectionFormat}}"]);
156
156
{{/isCollectionFormatMulti}}
157
157
}
158
158
{{/isListContainer}}
159
159
{{^isListContainer}}
160
160
if ({{paramName}} !== undefined) {
161
161
{{#isDateTime}}
162
- queryParameter ['{{baseName}}'] = ({{paramName}} as any).toISOString();
162
+ localVarQueryParameter ['{{baseName}}'] = ({{paramName}} as any).toISOString();
163
163
{{/isDateTime}}
164
164
{{^isDateTime}}
165
165
{{#isDate}}
166
- queryParameter ['{{baseName}}'] = ({{paramName}} as any).toISOString();
166
+ localVarQueryParameter ['{{baseName}}'] = ({{paramName}} as any).toISOString();
167
167
{{/isDate}}
168
168
{{^isDate}}
169
- queryParameter ['{{baseName}}'] = {{paramName}};
169
+ localVarQueryParameter ['{{baseName}}'] = {{paramName}};
170
170
{{/isDate}}
171
171
{{/isDateTime}}
172
172
}
@@ -176,12 +176,12 @@ export const {{classname}}FetchParamCreator = function (configuration?: Configur
176
176
{{#headerParams}}
177
177
{{#isListContainer}}
178
178
if ({{paramName}}) {
179
- headerParameter ['{{baseName}}'] = {{paramName}}.join(COLLECTION_FORMATS["{{collectionFormat}}"]));
179
+ localVarHeaderParameter ['{{baseName}}'] = {{paramName}}.join(COLLECTION_FORMATS["{{collectionFormat}}"]));
180
180
}
181
181
{{/isListContainer}}
182
182
{{^isListContainer}}
183
183
if ({{paramName}} !== undefined && {{paramName}} !== null) {
184
- headerParameter ['{{baseName}}'] = String({{paramName}});
184
+ localVarHeaderParameter ['{{baseName}}'] = String({{paramName}});
185
185
}
186
186
{{/isListContainer}}
187
187
@@ -191,43 +191,43 @@ export const {{classname}}FetchParamCreator = function (configuration?: Configur
191
191
if ({{paramName}}) {
192
192
{{#isCollectionFormatMulti}}
193
193
{{paramName}}.forEach((element) => {
194
- formParams .append('{{baseName}}', element as any);
194
+ localVarFormParams .append('{{baseName}}', element as any);
195
195
})
196
196
{{/isCollectionFormatMulti}}
197
197
{{^isCollectionFormatMulti}}
198
- formParams .set('{{baseName}}', {{paramName}}.join(COLLECTION_FORMATS["{{collectionFormat}}"]));
198
+ localVarFormParams .set('{{baseName}}', {{paramName}}.join(COLLECTION_FORMATS["{{collectionFormat}}"]));
199
199
{{/isCollectionFormatMulti}}
200
200
}
201
201
{{/isListContainer}}
202
202
{{^isListContainer}}
203
203
if ({{paramName}} !== undefined) {
204
- formParams .set('{{baseName}}', {{paramName}} as any);
204
+ localVarFormParams .set('{{baseName}}', {{paramName}} as any);
205
205
}
206
206
{{/isListContainer}}
207
207
208
208
{{/formParams}}
209
209
{{#hasFormParams}}
210
- headerParameter ['Content-Type'] = 'application/x-www-form-urlencoded';
210
+ localVarHeaderParameter ['Content-Type'] = 'application/x-www-form-urlencoded';
211
211
212
212
{{/hasFormParams}}
213
213
{{#bodyParam}}
214
- headerParameter ['Content-Type'] = 'application/json';
214
+ localVarHeaderParameter ['Content-Type'] = 'application/json';
215
215
216
216
{{/bodyParam}}
217
- urlObj .query = Object.assign({}, urlObj .query, queryParameter , options.query);
217
+ localVarUrlObj .query = Object.assign({}, localVarUrlObj .query, localVarQueryParameter , options.query);
218
218
// fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
219
- delete urlObj .search;
220
- requestOptions .headers = Object.assign({}, headerParameter , options.headers);
219
+ delete localVarUrlObj .search;
220
+ localVarRequestOptions .headers = Object.assign({}, localVarHeaderParameter , options.headers);
221
221
{{#hasFormParams}}
222
- requestOptions .body = formParams .toString();
222
+ localVarRequestOptions .body = localVarFormParams .toString();
223
223
{{/hasFormParams}}
224
224
{{#bodyParam}}
225
- requestOptions .body = JSON.stringify({{paramName}} || {});
225
+ localVarRequestOptions .body = JSON.stringify({{paramName}} || {});
226
226
{{/bodyParam}}
227
227
228
228
return {
229
- url: url.format(urlObj ),
230
- options: requestOptions ,
229
+ url: url.format(localVarUrlObj ),
230
+ options: localVarRequestOptions ,
231
231
};
232
232
},
233
233
{{/operation}}
@@ -254,9 +254,9 @@ export const {{classname}}Fp = function(configuration?: Configuration) {
254
254
* @throws { RequiredError}
255
255
*/
256
256
{ {nickname} }({ {#allParams} }{ {paramName} }{ {^required} }?{ {/required} }: { {{dataType} }}, { {/allParams} }options?: any): (fetch?: FetchAPI, basePath?: string) => Promise<{ {#returnType} }{ {{returnType} }}{ {/returnType} }{ {^returnType} }any{ {/returnType} }> {
257
- const fetchArgs = {{classname} }FetchParamCreator(configuration).{ {nickname} }({ {#allParams} }{ {paramName} }, { {/allParams} }options);
257
+ const localVarFetchArgs = {{classname} }FetchParamCreator(configuration).{ {nickname} }({ {#allParams} }{ {paramName} }, { {/allParams} }options);
258
258
return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => {
259
- return fetch (basePath + fetchArgs .url, fetchArgs .options).then((response) => {
259
+ return fetch (basePath + localVarFetchArgs .url, localVarFetchArgs .options).then((response) => {
260
260
if (response.status >= 200 && response.status < 300) {
261
261
return response{{#returnType} }.json(){ {/returnType} };
262
262
} else {
0 commit comments