@@ -37,7 +37,7 @@ export interface RequestArgs {
3737export class BaseAPI {
3838 protected configuration: Configuration | undefined;
3939
40- constructor(configuration?: Configuration, protected basePath: string = BASE_PATH) {
40+ constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected axios: AxiosInstance = globalAxios ) {
4141 if (configuration) {
4242 this.configuration = configuration;
4343 this.basePath = configuration.basePath || this.basePath;
@@ -252,13 +252,12 @@ export const {{classname}}Fp = function(configuration?: Configuration) {
252252 {{#allParams}}
253253 * @param {{=<% %>=}}{<%&dataType%>}<%={{ }}=%> {{^required}}[{{/required}}{{paramName}}{{^required}}]{{/required}} {{description}}
254254 {{/allParams}}
255- * @param {*} [options] Override http request option.
256- * @param { AxiosInstance} [axios] Custom axios instance.
255+ * @param {*} [options] Override http request option.
257256 * @throws { RequiredError}
258257 */
259- { {nickname} }({ {#allParams} }{ {paramName} }{ {^required} }?{ {/required} }: { {{dataType} }}, { {/allParams} }options?: any, axios: AxiosInstance = globalAxios): ( basePath?: string) => AxiosPromise<{ {#returnType} }{ {{returnType} }}{ {/returnType} }{ {^returnType} }Response{ {/returnType} }> {
258+ { {nickname} }({ {#allParams} }{ {paramName} }{ {^required} }?{ {/required} }: { {{dataType} }}, { {/allParams} }options?: any): ( axios? : AxiosInstance, basePath?: string) => AxiosPromise<{ {#returnType} }{ {{returnType} }}{ {/returnType} }{ {^returnType} }Response{ {/returnType} }> {
260259 const localVarAxiosArgs = {{classname} }AxiosParamCreator(configuration).{ {nickname} }({ {#allParams} }{ {paramName} }, { {/allParams} }options);
261- return (basePath: string = BASE_PATH) => {
260+ return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
262261 const axiosRequestArgs = Object.assign (localVarAxiosArgs.options, {url: basePath + localVarAxiosArgs.url} )
263262 return axios.request(axiosRequestArgs);
264263 };
@@ -272,7 +271,7 @@ export const {{classname}}Fp = function(configuration?: Configuration) {
272271 * { {&description} }{ {/description} }
273272 * @export
274273 */
275- export const { {classname} }Factory = function (configuration?: Configuration, basePath?: string) {
274+ export const { {classname} }Factory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance ) {
276275 return {
277276 {{#operation} }
278277 /**
@@ -284,11 +283,10 @@ export const {{classname}}Factory = function (configuration?: Configuration, bas
284283 * @param { {=<% %>= } }{ <% &dataType%> } <%={ { } }=%> { {^required} }[{ {/required} }{ {paramName} }{ {^required} }]{ {/required} } { {description} }
285284 { {/allParams} }
286285 * @param { *} [options] Override http request option.
287- * @param {AxiosInstance} [axios] Custom axios instance.
288286 * @throws {RequiredError}
289287 */
290- {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}options?: any, axios: AxiosInstance = globalAxios ) {
291- return {{classname}}Fp(configuration).{{nickname}}({{#allParams}}{{paramName}}, {{/allParams}}options, axios)( basePath);
288+ {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}options?: any) {
289+ return {{classname}}Fp(configuration).{{nickname}}({{#allParams}}{{paramName}}, {{/allParams}}options)(axios, basePath);
292290 },
293291 {{/operation}}
294292 };
@@ -312,11 +310,10 @@ export interface {{classname}}Interface {
312310 * @param {{=<% %>=}}{<%&dataType%>}<%={{ }}=%> {{^required}}[{{/required}}{{paramName}}{{^required}}]{{/required}} {{description}}
313311 {{/allParams}}
314312 * @param {*} [options] Override http request option.
315- * @param { AxiosInstance} [axios] Custom axios instance.
316313 * @throws { RequiredError}
317314 * @memberof { {classname} }Interface
318315 */
319- { {nickname} }({ {#allParams} }{ {paramName} }{ {^required} }?{ {/required} }: { {{dataType} }}, { {/allParams} }options?: any, axios: AxiosInstance = globalAxios ): AxiosPromise<{ {#returnType} }{ {{returnType} }}{ {/returnType} }{ {^returnType} }{ } { {/returnType} }>;
316+ { {nickname} }({ {#allParams} }{ {paramName} }{ {^required} }?{ {/required} }: { {{dataType} }}, { {/allParams} }options?: any): AxiosPromise<{ {#returnType} }{ {{returnType} }}{ {/returnType} }{ {^returnType} }{ } { {/returnType} }>;
320317
321318{ {/operation} }
322319}
@@ -345,12 +342,11 @@ export class {{classname}} extends BaseAPI {
345342 * @param { {=<% %>= } }{ <% &dataType%> } <%={ { } }=%> { {^required} }[{ {/required} }{ {paramName} }{ {^required} }]{ {/required} } { {description} }
346343 { {/allParams} }
347344 * @param { *} [options] Override http request option.
348- * @param {AxiosInstance} [axios] Custom axios instance.
349345 * @throws {RequiredError}
350346 * @memberof {{classname}}
351347 */
352- public {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}options?: any, axios: AxiosInstance = globalAxios ) {
353- return {{classname}}Fp(this.configuration).{{nickname}}({{#allParams}}{{paramName}}, {{/allParams}}options, axios)( this.basePath);
348+ public {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}options?: any) {
349+ return {{classname}}Fp(this.configuration).{{nickname}}({{#allParams}}{{paramName}}, {{/allParams}}options)(this.axios, this.basePath);
354350 }
355351
356352 {{/operation}}
0 commit comments