diff --git a/modules/openapi-generator/src/main/resources/typescript-nestjs/api.service.mustache b/modules/openapi-generator/src/main/resources/typescript-nestjs/api.service.mustache index 12bf8d23886..87f73c75d52 100644 --- a/modules/openapi-generator/src/main/resources/typescript-nestjs/api.service.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-nestjs/api.service.mustache @@ -8,7 +8,7 @@ import { HttpService } from '@nestjs/axios'; {{^useAxiosHttpModule}} import { HttpService, Injectable, Optional } from '@nestjs/common'; {{/useAxiosHttpModule}} -import { AxiosResponse } from 'axios'; +import type { AxiosRequestConfig, AxiosResponse } from 'axios'; import { Observable, from, of, switchMap } from 'rxjs'; {{#imports}} import { {{classname}} } from '../{{filename}}'; @@ -93,14 +93,15 @@ export class {{classname}} { {{/allParams}}* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. {{/useSingleRequestParameter}} + * @param {*} [{{nickname}}Opts.config] Override http request option. */ {{#useSingleRequestParameter}} - public {{nickname}}({{#allParams.0}}requestParameters: {{classname}}{{operationIdCamelCase}}Request, {{/allParams.0}}): Observable>; - public {{nickname}}({{#allParams.0}}requestParameters: {{classname}}{{operationIdCamelCase}}Request, {{/allParams.0}}): Observable { + public {{nickname}}({{#allParams.0}}requestParameters: {{classname}}{{operationIdCamelCase}}Request, {{/allParams.0}}{{nickname}}Opts?: { config?: AxiosRequestConfig }): Observable>; + public {{nickname}}({{#allParams.0}}requestParameters: {{classname}}{{operationIdCamelCase}}Request, {{/allParams.0}}{{nickname}}Opts?: { config?: AxiosRequestConfig }): Observable { {{/useSingleRequestParameter}} {{^useSingleRequestParameter}} - public {{nickname}}({{#allParams}}{{^isConstEnumParam}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/isConstEnumParam}}{{/allParams}}): Observable>; - public {{nickname}}({{#allParams}}{{^isConstEnumParam}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/isConstEnumParam}}{{/allParams}}): Observable { + public {{nickname}}({{#allParams}}{{^isConstEnumParam}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/isConstEnumParam}}{{/allParams}}{{nickname}}Opts?: { config?: AxiosRequestConfig }): Observable>; + public {{nickname}}({{#allParams}}{{^isConstEnumParam}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/isConstEnumParam}}{{/allParams}}{{nickname}}Opts?: { config?: AxiosRequestConfig }): Observable { {{/useSingleRequestParameter}} {{#allParams.0}} {{#useSingleRequestParameter}} @@ -291,7 +292,8 @@ export class {{classname}} { responseType: "blob", {{/isResponseFile}} withCredentials: this.configuration.withCredentials, - headers: headers + ...{{nickname}}Opts?.config, + headers: {...headers, ...{{nickname}}Opts?.config?.headers}, } ); }) diff --git a/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/api/pet.service.ts index 1f0ae5010da..81bbb54a9ca 100644 --- a/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/api/pet.service.ts @@ -12,7 +12,7 @@ /* tslint:disable:no-unused-variable member-ordering */ import { HttpService, Injectable, Optional } from '@nestjs/common'; -import { AxiosResponse } from 'axios'; +import type { AxiosRequestConfig, AxiosResponse } from 'axios'; import { Observable, from, of, switchMap } from 'rxjs'; import { ApiResponse } from '../model/apiResponse'; import { Pet } from '../model/pet'; @@ -49,9 +49,10 @@ export class PetService { * @param pet Pet object that needs to be added to the store * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. + * @param {*} [addPetOpts.config] Override http request option. */ - public addPet(pet: Pet, ): Observable>; - public addPet(pet: Pet, ): Observable { + public addPet(pet: Pet, addPetOpts?: { config?: AxiosRequestConfig }): Observable>; + public addPet(pet: Pet, addPetOpts?: { config?: AxiosRequestConfig }): Observable { if (pet === null || pet === undefined) { throw new Error('Required parameter pet was null or undefined when calling addPet.'); } @@ -96,7 +97,8 @@ export class PetService { pet, { withCredentials: this.configuration.withCredentials, - headers: headers + ...addPetOpts?.config, + headers: {...headers, ...addPetOpts?.config?.headers}, } ); }) @@ -109,9 +111,10 @@ export class PetService { * @param apiKey * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. + * @param {*} [deletePetOpts.config] Override http request option. */ - public deletePet(petId: number, apiKey?: string, ): Observable>; - public deletePet(petId: number, apiKey?: string, ): Observable { + public deletePet(petId: number, apiKey?: string, deletePetOpts?: { config?: AxiosRequestConfig }): Observable>; + public deletePet(petId: number, apiKey?: string, deletePetOpts?: { config?: AxiosRequestConfig }): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling deletePet.'); } @@ -150,7 +153,8 @@ export class PetService { return this.httpClient.delete(`${this.basePath}/pet/${encodeURIComponent(String(petId))}`, { withCredentials: this.configuration.withCredentials, - headers: headers + ...deletePetOpts?.config, + headers: {...headers, ...deletePetOpts?.config?.headers}, } ); }) @@ -162,9 +166,10 @@ export class PetService { * @param status Status values that need to be considered for filter * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. + * @param {*} [findPetsByStatusOpts.config] Override http request option. */ - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, ): Observable>>; - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, ): Observable { + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, findPetsByStatusOpts?: { config?: AxiosRequestConfig }): Observable>>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, findPetsByStatusOpts?: { config?: AxiosRequestConfig }): Observable { if (status === null || status === undefined) { throw new Error('Required parameter status was null or undefined when calling findPetsByStatus.'); } @@ -208,7 +213,8 @@ export class PetService { { params: queryParameters, withCredentials: this.configuration.withCredentials, - headers: headers + ...findPetsByStatusOpts?.config, + headers: {...headers, ...findPetsByStatusOpts?.config?.headers}, } ); }) @@ -220,9 +226,10 @@ export class PetService { * @param tags Tags to filter by * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. + * @param {*} [findPetsByTagsOpts.config] Override http request option. */ - public findPetsByTags(tags: Array, ): Observable>>; - public findPetsByTags(tags: Array, ): Observable { + public findPetsByTags(tags: Array, findPetsByTagsOpts?: { config?: AxiosRequestConfig }): Observable>>; + public findPetsByTags(tags: Array, findPetsByTagsOpts?: { config?: AxiosRequestConfig }): Observable { if (tags === null || tags === undefined) { throw new Error('Required parameter tags was null or undefined when calling findPetsByTags.'); } @@ -266,7 +273,8 @@ export class PetService { { params: queryParameters, withCredentials: this.configuration.withCredentials, - headers: headers + ...findPetsByTagsOpts?.config, + headers: {...headers, ...findPetsByTagsOpts?.config?.headers}, } ); }) @@ -278,9 +286,10 @@ export class PetService { * @param petId ID of pet to return * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. + * @param {*} [getPetByIdOpts.config] Override http request option. */ - public getPetById(petId: number, ): Observable>; - public getPetById(petId: number, ): Observable { + public getPetById(petId: number, getPetByIdOpts?: { config?: AxiosRequestConfig }): Observable>; + public getPetById(petId: number, getPetByIdOpts?: { config?: AxiosRequestConfig }): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling getPetById.'); } @@ -316,7 +325,8 @@ export class PetService { return this.httpClient.get(`${this.basePath}/pet/${encodeURIComponent(String(petId))}`, { withCredentials: this.configuration.withCredentials, - headers: headers + ...getPetByIdOpts?.config, + headers: {...headers, ...getPetByIdOpts?.config?.headers}, } ); }) @@ -328,9 +338,10 @@ export class PetService { * @param pet Pet object that needs to be added to the store * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. + * @param {*} [updatePetOpts.config] Override http request option. */ - public updatePet(pet: Pet, ): Observable>; - public updatePet(pet: Pet, ): Observable { + public updatePet(pet: Pet, updatePetOpts?: { config?: AxiosRequestConfig }): Observable>; + public updatePet(pet: Pet, updatePetOpts?: { config?: AxiosRequestConfig }): Observable { if (pet === null || pet === undefined) { throw new Error('Required parameter pet was null or undefined when calling updatePet.'); } @@ -375,7 +386,8 @@ export class PetService { pet, { withCredentials: this.configuration.withCredentials, - headers: headers + ...updatePetOpts?.config, + headers: {...headers, ...updatePetOpts?.config?.headers}, } ); }) @@ -389,9 +401,10 @@ export class PetService { * @param status Updated status of the pet * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. + * @param {*} [updatePetWithFormOpts.config] Override http request option. */ - public updatePetWithForm(petId: number, name?: string, status?: string, ): Observable>; - public updatePetWithForm(petId: number, name?: string, status?: string, ): Observable { + public updatePetWithForm(petId: number, name?: string, status?: string, updatePetWithFormOpts?: { config?: AxiosRequestConfig }): Observable>; + public updatePetWithForm(petId: number, name?: string, status?: string, updatePetWithFormOpts?: { config?: AxiosRequestConfig }): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling updatePetWithForm.'); } @@ -449,7 +462,8 @@ export class PetService { convertFormParamsToString ? formParams!.toString() : formParams!, { withCredentials: this.configuration.withCredentials, - headers: headers + ...updatePetWithFormOpts?.config, + headers: {...headers, ...updatePetWithFormOpts?.config?.headers}, } ); }) @@ -463,9 +477,10 @@ export class PetService { * @param file file to upload * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. + * @param {*} [uploadFileOpts.config] Override http request option. */ - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, ): Observable>; - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, ): Observable { + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, uploadFileOpts?: { config?: AxiosRequestConfig }): Observable>; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, uploadFileOpts?: { config?: AxiosRequestConfig }): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling uploadFile.'); } @@ -528,7 +543,8 @@ export class PetService { convertFormParamsToString ? formParams!.toString() : formParams!, { withCredentials: this.configuration.withCredentials, - headers: headers + ...uploadFileOpts?.config, + headers: {...headers, ...uploadFileOpts?.config?.headers}, } ); }) diff --git a/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/api/store.service.ts index 94297bee306..ddbcb72df5e 100644 --- a/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/api/store.service.ts @@ -12,7 +12,7 @@ /* tslint:disable:no-unused-variable member-ordering */ import { HttpService, Injectable, Optional } from '@nestjs/common'; -import { AxiosResponse } from 'axios'; +import type { AxiosRequestConfig, AxiosResponse } from 'axios'; import { Observable, from, of, switchMap } from 'rxjs'; import { Order } from '../model/order'; import { Configuration } from '../configuration'; @@ -48,9 +48,10 @@ export class StoreService { * @param orderId ID of the order that needs to be deleted * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. + * @param {*} [deleteOrderOpts.config] Override http request option. */ - public deleteOrder(orderId: string, ): Observable>; - public deleteOrder(orderId: string, ): Observable { + public deleteOrder(orderId: string, deleteOrderOpts?: { config?: AxiosRequestConfig }): Observable>; + public deleteOrder(orderId: string, deleteOrderOpts?: { config?: AxiosRequestConfig }): Observable { if (orderId === null || orderId === undefined) { throw new Error('Required parameter orderId was null or undefined when calling deleteOrder.'); } @@ -79,7 +80,8 @@ export class StoreService { return this.httpClient.delete(`${this.basePath}/store/order/${encodeURIComponent(String(orderId))}`, { withCredentials: this.configuration.withCredentials, - headers: headers + ...deleteOrderOpts?.config, + headers: {...headers, ...deleteOrderOpts?.config?.headers}, } ); }) @@ -90,9 +92,10 @@ export class StoreService { * Returns a map of status codes to quantities * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. + * @param {*} [getInventoryOpts.config] Override http request option. */ - public getInventory(): Observable>; - public getInventory(): Observable { + public getInventory(getInventoryOpts?: { config?: AxiosRequestConfig }): Observable>; + public getInventory(getInventoryOpts?: { config?: AxiosRequestConfig }): Observable { let headers = {...this.defaultHeaders}; let accessTokenObservable: Observable = of(null); @@ -123,7 +126,8 @@ export class StoreService { return this.httpClient.get<{ [key: string]: number; }>(`${this.basePath}/store/inventory`, { withCredentials: this.configuration.withCredentials, - headers: headers + ...getInventoryOpts?.config, + headers: {...headers, ...getInventoryOpts?.config?.headers}, } ); }) @@ -135,9 +139,10 @@ export class StoreService { * @param orderId ID of pet that needs to be fetched * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. + * @param {*} [getOrderByIdOpts.config] Override http request option. */ - public getOrderById(orderId: number, ): Observable>; - public getOrderById(orderId: number, ): Observable { + public getOrderById(orderId: number, getOrderByIdOpts?: { config?: AxiosRequestConfig }): Observable>; + public getOrderById(orderId: number, getOrderByIdOpts?: { config?: AxiosRequestConfig }): Observable { if (orderId === null || orderId === undefined) { throw new Error('Required parameter orderId was null or undefined when calling getOrderById.'); } @@ -168,7 +173,8 @@ export class StoreService { return this.httpClient.get(`${this.basePath}/store/order/${encodeURIComponent(String(orderId))}`, { withCredentials: this.configuration.withCredentials, - headers: headers + ...getOrderByIdOpts?.config, + headers: {...headers, ...getOrderByIdOpts?.config?.headers}, } ); }) @@ -180,9 +186,10 @@ export class StoreService { * @param order order placed for purchasing the pet * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. + * @param {*} [placeOrderOpts.config] Override http request option. */ - public placeOrder(order: Order, ): Observable>; - public placeOrder(order: Order, ): Observable { + public placeOrder(order: Order, placeOrderOpts?: { config?: AxiosRequestConfig }): Observable>; + public placeOrder(order: Order, placeOrderOpts?: { config?: AxiosRequestConfig }): Observable { if (order === null || order === undefined) { throw new Error('Required parameter order was null or undefined when calling placeOrder.'); } @@ -219,7 +226,8 @@ export class StoreService { order, { withCredentials: this.configuration.withCredentials, - headers: headers + ...placeOrderOpts?.config, + headers: {...headers, ...placeOrderOpts?.config?.headers}, } ); }) diff --git a/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/api/user.service.ts index ab3450300f7..c968d4f07ce 100644 --- a/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/api/user.service.ts @@ -12,7 +12,7 @@ /* tslint:disable:no-unused-variable member-ordering */ import { HttpService, Injectable, Optional } from '@nestjs/common'; -import { AxiosResponse } from 'axios'; +import type { AxiosRequestConfig, AxiosResponse } from 'axios'; import { Observable, from, of, switchMap } from 'rxjs'; import { User } from '../model/user'; import { Configuration } from '../configuration'; @@ -48,9 +48,10 @@ export class UserService { * @param user Created user object * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. + * @param {*} [createUserOpts.config] Override http request option. */ - public createUser(user: User, ): Observable>; - public createUser(user: User, ): Observable { + public createUser(user: User, createUserOpts?: { config?: AxiosRequestConfig }): Observable>; + public createUser(user: User, createUserOpts?: { config?: AxiosRequestConfig }): Observable { if (user === null || user === undefined) { throw new Error('Required parameter user was null or undefined when calling createUser.'); } @@ -90,7 +91,8 @@ export class UserService { user, { withCredentials: this.configuration.withCredentials, - headers: headers + ...createUserOpts?.config, + headers: {...headers, ...createUserOpts?.config?.headers}, } ); }) @@ -102,9 +104,10 @@ export class UserService { * @param user List of user object * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. + * @param {*} [createUsersWithArrayInputOpts.config] Override http request option. */ - public createUsersWithArrayInput(user: Array, ): Observable>; - public createUsersWithArrayInput(user: Array, ): Observable { + public createUsersWithArrayInput(user: Array, createUsersWithArrayInputOpts?: { config?: AxiosRequestConfig }): Observable>; + public createUsersWithArrayInput(user: Array, createUsersWithArrayInputOpts?: { config?: AxiosRequestConfig }): Observable { if (user === null || user === undefined) { throw new Error('Required parameter user was null or undefined when calling createUsersWithArrayInput.'); } @@ -144,7 +147,8 @@ export class UserService { user, { withCredentials: this.configuration.withCredentials, - headers: headers + ...createUsersWithArrayInputOpts?.config, + headers: {...headers, ...createUsersWithArrayInputOpts?.config?.headers}, } ); }) @@ -156,9 +160,10 @@ export class UserService { * @param user List of user object * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. + * @param {*} [createUsersWithListInputOpts.config] Override http request option. */ - public createUsersWithListInput(user: Array, ): Observable>; - public createUsersWithListInput(user: Array, ): Observable { + public createUsersWithListInput(user: Array, createUsersWithListInputOpts?: { config?: AxiosRequestConfig }): Observable>; + public createUsersWithListInput(user: Array, createUsersWithListInputOpts?: { config?: AxiosRequestConfig }): Observable { if (user === null || user === undefined) { throw new Error('Required parameter user was null or undefined when calling createUsersWithListInput.'); } @@ -198,7 +203,8 @@ export class UserService { user, { withCredentials: this.configuration.withCredentials, - headers: headers + ...createUsersWithListInputOpts?.config, + headers: {...headers, ...createUsersWithListInputOpts?.config?.headers}, } ); }) @@ -210,9 +216,10 @@ export class UserService { * @param username The name that needs to be deleted * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. + * @param {*} [deleteUserOpts.config] Override http request option. */ - public deleteUser(username: string, ): Observable>; - public deleteUser(username: string, ): Observable { + public deleteUser(username: string, deleteUserOpts?: { config?: AxiosRequestConfig }): Observable>; + public deleteUser(username: string, deleteUserOpts?: { config?: AxiosRequestConfig }): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling deleteUser.'); } @@ -246,7 +253,8 @@ export class UserService { return this.httpClient.delete(`${this.basePath}/user/${encodeURIComponent(String(username))}`, { withCredentials: this.configuration.withCredentials, - headers: headers + ...deleteUserOpts?.config, + headers: {...headers, ...deleteUserOpts?.config?.headers}, } ); }) @@ -258,9 +266,10 @@ export class UserService { * @param username The name that needs to be fetched. Use user1 for testing. * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. + * @param {*} [getUserByNameOpts.config] Override http request option. */ - public getUserByName(username: string, ): Observable>; - public getUserByName(username: string, ): Observable { + public getUserByName(username: string, getUserByNameOpts?: { config?: AxiosRequestConfig }): Observable>; + public getUserByName(username: string, getUserByNameOpts?: { config?: AxiosRequestConfig }): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling getUserByName.'); } @@ -291,7 +300,8 @@ export class UserService { return this.httpClient.get(`${this.basePath}/user/${encodeURIComponent(String(username))}`, { withCredentials: this.configuration.withCredentials, - headers: headers + ...getUserByNameOpts?.config, + headers: {...headers, ...getUserByNameOpts?.config?.headers}, } ); }) @@ -304,9 +314,10 @@ export class UserService { * @param password The password for login in clear text * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. + * @param {*} [loginUserOpts.config] Override http request option. */ - public loginUser(username: string, password: string, ): Observable>; - public loginUser(username: string, password: string, ): Observable { + public loginUser(username: string, password: string, loginUserOpts?: { config?: AxiosRequestConfig }): Observable>; + public loginUser(username: string, password: string, loginUserOpts?: { config?: AxiosRequestConfig }): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling loginUser.'); } @@ -350,7 +361,8 @@ export class UserService { { params: queryParameters, withCredentials: this.configuration.withCredentials, - headers: headers + ...loginUserOpts?.config, + headers: {...headers, ...loginUserOpts?.config?.headers}, } ); }) @@ -361,9 +373,10 @@ export class UserService { * * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. + * @param {*} [logoutUserOpts.config] Override http request option. */ - public logoutUser(): Observable>; - public logoutUser(): Observable { + public logoutUser(logoutUserOpts?: { config?: AxiosRequestConfig }): Observable>; + public logoutUser(logoutUserOpts?: { config?: AxiosRequestConfig }): Observable { let headers = {...this.defaultHeaders}; let accessTokenObservable: Observable = of(null); @@ -393,7 +406,8 @@ export class UserService { return this.httpClient.get(`${this.basePath}/user/logout`, { withCredentials: this.configuration.withCredentials, - headers: headers + ...logoutUserOpts?.config, + headers: {...headers, ...logoutUserOpts?.config?.headers}, } ); }) @@ -406,9 +420,10 @@ export class UserService { * @param user Updated user object * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. + * @param {*} [updateUserOpts.config] Override http request option. */ - public updateUser(username: string, user: User, ): Observable>; - public updateUser(username: string, user: User, ): Observable { + public updateUser(username: string, user: User, updateUserOpts?: { config?: AxiosRequestConfig }): Observable>; + public updateUser(username: string, user: User, updateUserOpts?: { config?: AxiosRequestConfig }): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling updateUser.'); } @@ -452,7 +467,8 @@ export class UserService { user, { withCredentials: this.configuration.withCredentials, - headers: headers + ...updateUserOpts?.config, + headers: {...headers, ...updateUserOpts?.config?.headers}, } ); }) diff --git a/samples/client/petstore/typescript-nestjs-v8-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-nestjs-v8-provided-in-root/builds/default/api/pet.service.ts index 5f68577397a..61cd6549aa0 100644 --- a/samples/client/petstore/typescript-nestjs-v8-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-nestjs-v8-provided-in-root/builds/default/api/pet.service.ts @@ -13,7 +13,7 @@ import { Injectable, Optional } from '@nestjs/common'; import { HttpService } from '@nestjs/axios'; -import { AxiosResponse } from 'axios'; +import type { AxiosRequestConfig, AxiosResponse } from 'axios'; import { Observable, from, of, switchMap } from 'rxjs'; import { ApiResponse } from '../model/apiResponse'; import { Pet } from '../model/pet'; @@ -50,9 +50,10 @@ export class PetService { * @param pet Pet object that needs to be added to the store * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. + * @param {*} [addPetOpts.config] Override http request option. */ - public addPet(pet: Pet, ): Observable>; - public addPet(pet: Pet, ): Observable { + public addPet(pet: Pet, addPetOpts?: { config?: AxiosRequestConfig }): Observable>; + public addPet(pet: Pet, addPetOpts?: { config?: AxiosRequestConfig }): Observable { if (pet === null || pet === undefined) { throw new Error('Required parameter pet was null or undefined when calling addPet.'); } @@ -97,7 +98,8 @@ export class PetService { pet, { withCredentials: this.configuration.withCredentials, - headers: headers + ...addPetOpts?.config, + headers: {...headers, ...addPetOpts?.config?.headers}, } ); }) @@ -110,9 +112,10 @@ export class PetService { * @param apiKey * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. + * @param {*} [deletePetOpts.config] Override http request option. */ - public deletePet(petId: number, apiKey?: string, ): Observable>; - public deletePet(petId: number, apiKey?: string, ): Observable { + public deletePet(petId: number, apiKey?: string, deletePetOpts?: { config?: AxiosRequestConfig }): Observable>; + public deletePet(petId: number, apiKey?: string, deletePetOpts?: { config?: AxiosRequestConfig }): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling deletePet.'); } @@ -151,7 +154,8 @@ export class PetService { return this.httpClient.delete(`${this.basePath}/pet/${encodeURIComponent(String(petId))}`, { withCredentials: this.configuration.withCredentials, - headers: headers + ...deletePetOpts?.config, + headers: {...headers, ...deletePetOpts?.config?.headers}, } ); }) @@ -163,9 +167,10 @@ export class PetService { * @param status Status values that need to be considered for filter * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. + * @param {*} [findPetsByStatusOpts.config] Override http request option. */ - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, ): Observable>>; - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, ): Observable { + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, findPetsByStatusOpts?: { config?: AxiosRequestConfig }): Observable>>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, findPetsByStatusOpts?: { config?: AxiosRequestConfig }): Observable { if (status === null || status === undefined) { throw new Error('Required parameter status was null or undefined when calling findPetsByStatus.'); } @@ -209,7 +214,8 @@ export class PetService { { params: queryParameters, withCredentials: this.configuration.withCredentials, - headers: headers + ...findPetsByStatusOpts?.config, + headers: {...headers, ...findPetsByStatusOpts?.config?.headers}, } ); }) @@ -221,9 +227,10 @@ export class PetService { * @param tags Tags to filter by * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. + * @param {*} [findPetsByTagsOpts.config] Override http request option. */ - public findPetsByTags(tags: Array, ): Observable>>; - public findPetsByTags(tags: Array, ): Observable { + public findPetsByTags(tags: Array, findPetsByTagsOpts?: { config?: AxiosRequestConfig }): Observable>>; + public findPetsByTags(tags: Array, findPetsByTagsOpts?: { config?: AxiosRequestConfig }): Observable { if (tags === null || tags === undefined) { throw new Error('Required parameter tags was null or undefined when calling findPetsByTags.'); } @@ -267,7 +274,8 @@ export class PetService { { params: queryParameters, withCredentials: this.configuration.withCredentials, - headers: headers + ...findPetsByTagsOpts?.config, + headers: {...headers, ...findPetsByTagsOpts?.config?.headers}, } ); }) @@ -279,9 +287,10 @@ export class PetService { * @param petId ID of pet to return * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. + * @param {*} [getPetByIdOpts.config] Override http request option. */ - public getPetById(petId: number, ): Observable>; - public getPetById(petId: number, ): Observable { + public getPetById(petId: number, getPetByIdOpts?: { config?: AxiosRequestConfig }): Observable>; + public getPetById(petId: number, getPetByIdOpts?: { config?: AxiosRequestConfig }): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling getPetById.'); } @@ -317,7 +326,8 @@ export class PetService { return this.httpClient.get(`${this.basePath}/pet/${encodeURIComponent(String(petId))}`, { withCredentials: this.configuration.withCredentials, - headers: headers + ...getPetByIdOpts?.config, + headers: {...headers, ...getPetByIdOpts?.config?.headers}, } ); }) @@ -329,9 +339,10 @@ export class PetService { * @param pet Pet object that needs to be added to the store * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. + * @param {*} [updatePetOpts.config] Override http request option. */ - public updatePet(pet: Pet, ): Observable>; - public updatePet(pet: Pet, ): Observable { + public updatePet(pet: Pet, updatePetOpts?: { config?: AxiosRequestConfig }): Observable>; + public updatePet(pet: Pet, updatePetOpts?: { config?: AxiosRequestConfig }): Observable { if (pet === null || pet === undefined) { throw new Error('Required parameter pet was null or undefined when calling updatePet.'); } @@ -376,7 +387,8 @@ export class PetService { pet, { withCredentials: this.configuration.withCredentials, - headers: headers + ...updatePetOpts?.config, + headers: {...headers, ...updatePetOpts?.config?.headers}, } ); }) @@ -390,9 +402,10 @@ export class PetService { * @param status Updated status of the pet * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. + * @param {*} [updatePetWithFormOpts.config] Override http request option. */ - public updatePetWithForm(petId: number, name?: string, status?: string, ): Observable>; - public updatePetWithForm(petId: number, name?: string, status?: string, ): Observable { + public updatePetWithForm(petId: number, name?: string, status?: string, updatePetWithFormOpts?: { config?: AxiosRequestConfig }): Observable>; + public updatePetWithForm(petId: number, name?: string, status?: string, updatePetWithFormOpts?: { config?: AxiosRequestConfig }): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling updatePetWithForm.'); } @@ -450,7 +463,8 @@ export class PetService { convertFormParamsToString ? formParams!.toString() : formParams!, { withCredentials: this.configuration.withCredentials, - headers: headers + ...updatePetWithFormOpts?.config, + headers: {...headers, ...updatePetWithFormOpts?.config?.headers}, } ); }) @@ -464,9 +478,10 @@ export class PetService { * @param file file to upload * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. + * @param {*} [uploadFileOpts.config] Override http request option. */ - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, ): Observable>; - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, ): Observable { + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, uploadFileOpts?: { config?: AxiosRequestConfig }): Observable>; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, uploadFileOpts?: { config?: AxiosRequestConfig }): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling uploadFile.'); } @@ -529,7 +544,8 @@ export class PetService { convertFormParamsToString ? formParams!.toString() : formParams!, { withCredentials: this.configuration.withCredentials, - headers: headers + ...uploadFileOpts?.config, + headers: {...headers, ...uploadFileOpts?.config?.headers}, } ); }) diff --git a/samples/client/petstore/typescript-nestjs-v8-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-nestjs-v8-provided-in-root/builds/default/api/store.service.ts index 72e0006fcb7..b3a704627f3 100644 --- a/samples/client/petstore/typescript-nestjs-v8-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-nestjs-v8-provided-in-root/builds/default/api/store.service.ts @@ -13,7 +13,7 @@ import { Injectable, Optional } from '@nestjs/common'; import { HttpService } from '@nestjs/axios'; -import { AxiosResponse } from 'axios'; +import type { AxiosRequestConfig, AxiosResponse } from 'axios'; import { Observable, from, of, switchMap } from 'rxjs'; import { Order } from '../model/order'; import { Configuration } from '../configuration'; @@ -49,9 +49,10 @@ export class StoreService { * @param orderId ID of the order that needs to be deleted * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. + * @param {*} [deleteOrderOpts.config] Override http request option. */ - public deleteOrder(orderId: string, ): Observable>; - public deleteOrder(orderId: string, ): Observable { + public deleteOrder(orderId: string, deleteOrderOpts?: { config?: AxiosRequestConfig }): Observable>; + public deleteOrder(orderId: string, deleteOrderOpts?: { config?: AxiosRequestConfig }): Observable { if (orderId === null || orderId === undefined) { throw new Error('Required parameter orderId was null or undefined when calling deleteOrder.'); } @@ -80,7 +81,8 @@ export class StoreService { return this.httpClient.delete(`${this.basePath}/store/order/${encodeURIComponent(String(orderId))}`, { withCredentials: this.configuration.withCredentials, - headers: headers + ...deleteOrderOpts?.config, + headers: {...headers, ...deleteOrderOpts?.config?.headers}, } ); }) @@ -91,9 +93,10 @@ export class StoreService { * Returns a map of status codes to quantities * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. + * @param {*} [getInventoryOpts.config] Override http request option. */ - public getInventory(): Observable>; - public getInventory(): Observable { + public getInventory(getInventoryOpts?: { config?: AxiosRequestConfig }): Observable>; + public getInventory(getInventoryOpts?: { config?: AxiosRequestConfig }): Observable { let headers = {...this.defaultHeaders}; let accessTokenObservable: Observable = of(null); @@ -124,7 +127,8 @@ export class StoreService { return this.httpClient.get<{ [key: string]: number; }>(`${this.basePath}/store/inventory`, { withCredentials: this.configuration.withCredentials, - headers: headers + ...getInventoryOpts?.config, + headers: {...headers, ...getInventoryOpts?.config?.headers}, } ); }) @@ -136,9 +140,10 @@ export class StoreService { * @param orderId ID of pet that needs to be fetched * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. + * @param {*} [getOrderByIdOpts.config] Override http request option. */ - public getOrderById(orderId: number, ): Observable>; - public getOrderById(orderId: number, ): Observable { + public getOrderById(orderId: number, getOrderByIdOpts?: { config?: AxiosRequestConfig }): Observable>; + public getOrderById(orderId: number, getOrderByIdOpts?: { config?: AxiosRequestConfig }): Observable { if (orderId === null || orderId === undefined) { throw new Error('Required parameter orderId was null or undefined when calling getOrderById.'); } @@ -169,7 +174,8 @@ export class StoreService { return this.httpClient.get(`${this.basePath}/store/order/${encodeURIComponent(String(orderId))}`, { withCredentials: this.configuration.withCredentials, - headers: headers + ...getOrderByIdOpts?.config, + headers: {...headers, ...getOrderByIdOpts?.config?.headers}, } ); }) @@ -181,9 +187,10 @@ export class StoreService { * @param order order placed for purchasing the pet * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. + * @param {*} [placeOrderOpts.config] Override http request option. */ - public placeOrder(order: Order, ): Observable>; - public placeOrder(order: Order, ): Observable { + public placeOrder(order: Order, placeOrderOpts?: { config?: AxiosRequestConfig }): Observable>; + public placeOrder(order: Order, placeOrderOpts?: { config?: AxiosRequestConfig }): Observable { if (order === null || order === undefined) { throw new Error('Required parameter order was null or undefined when calling placeOrder.'); } @@ -220,7 +227,8 @@ export class StoreService { order, { withCredentials: this.configuration.withCredentials, - headers: headers + ...placeOrderOpts?.config, + headers: {...headers, ...placeOrderOpts?.config?.headers}, } ); }) diff --git a/samples/client/petstore/typescript-nestjs-v8-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-nestjs-v8-provided-in-root/builds/default/api/user.service.ts index d55838c23a1..4332b9d3dc4 100644 --- a/samples/client/petstore/typescript-nestjs-v8-provided-in-root/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-nestjs-v8-provided-in-root/builds/default/api/user.service.ts @@ -13,7 +13,7 @@ import { Injectable, Optional } from '@nestjs/common'; import { HttpService } from '@nestjs/axios'; -import { AxiosResponse } from 'axios'; +import type { AxiosRequestConfig, AxiosResponse } from 'axios'; import { Observable, from, of, switchMap } from 'rxjs'; import { User } from '../model/user'; import { Configuration } from '../configuration'; @@ -49,9 +49,10 @@ export class UserService { * @param user Created user object * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. + * @param {*} [createUserOpts.config] Override http request option. */ - public createUser(user: User, ): Observable>; - public createUser(user: User, ): Observable { + public createUser(user: User, createUserOpts?: { config?: AxiosRequestConfig }): Observable>; + public createUser(user: User, createUserOpts?: { config?: AxiosRequestConfig }): Observable { if (user === null || user === undefined) { throw new Error('Required parameter user was null or undefined when calling createUser.'); } @@ -91,7 +92,8 @@ export class UserService { user, { withCredentials: this.configuration.withCredentials, - headers: headers + ...createUserOpts?.config, + headers: {...headers, ...createUserOpts?.config?.headers}, } ); }) @@ -103,9 +105,10 @@ export class UserService { * @param user List of user object * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. + * @param {*} [createUsersWithArrayInputOpts.config] Override http request option. */ - public createUsersWithArrayInput(user: Array, ): Observable>; - public createUsersWithArrayInput(user: Array, ): Observable { + public createUsersWithArrayInput(user: Array, createUsersWithArrayInputOpts?: { config?: AxiosRequestConfig }): Observable>; + public createUsersWithArrayInput(user: Array, createUsersWithArrayInputOpts?: { config?: AxiosRequestConfig }): Observable { if (user === null || user === undefined) { throw new Error('Required parameter user was null or undefined when calling createUsersWithArrayInput.'); } @@ -145,7 +148,8 @@ export class UserService { user, { withCredentials: this.configuration.withCredentials, - headers: headers + ...createUsersWithArrayInputOpts?.config, + headers: {...headers, ...createUsersWithArrayInputOpts?.config?.headers}, } ); }) @@ -157,9 +161,10 @@ export class UserService { * @param user List of user object * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. + * @param {*} [createUsersWithListInputOpts.config] Override http request option. */ - public createUsersWithListInput(user: Array, ): Observable>; - public createUsersWithListInput(user: Array, ): Observable { + public createUsersWithListInput(user: Array, createUsersWithListInputOpts?: { config?: AxiosRequestConfig }): Observable>; + public createUsersWithListInput(user: Array, createUsersWithListInputOpts?: { config?: AxiosRequestConfig }): Observable { if (user === null || user === undefined) { throw new Error('Required parameter user was null or undefined when calling createUsersWithListInput.'); } @@ -199,7 +204,8 @@ export class UserService { user, { withCredentials: this.configuration.withCredentials, - headers: headers + ...createUsersWithListInputOpts?.config, + headers: {...headers, ...createUsersWithListInputOpts?.config?.headers}, } ); }) @@ -211,9 +217,10 @@ export class UserService { * @param username The name that needs to be deleted * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. + * @param {*} [deleteUserOpts.config] Override http request option. */ - public deleteUser(username: string, ): Observable>; - public deleteUser(username: string, ): Observable { + public deleteUser(username: string, deleteUserOpts?: { config?: AxiosRequestConfig }): Observable>; + public deleteUser(username: string, deleteUserOpts?: { config?: AxiosRequestConfig }): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling deleteUser.'); } @@ -247,7 +254,8 @@ export class UserService { return this.httpClient.delete(`${this.basePath}/user/${encodeURIComponent(String(username))}`, { withCredentials: this.configuration.withCredentials, - headers: headers + ...deleteUserOpts?.config, + headers: {...headers, ...deleteUserOpts?.config?.headers}, } ); }) @@ -259,9 +267,10 @@ export class UserService { * @param username The name that needs to be fetched. Use user1 for testing. * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. + * @param {*} [getUserByNameOpts.config] Override http request option. */ - public getUserByName(username: string, ): Observable>; - public getUserByName(username: string, ): Observable { + public getUserByName(username: string, getUserByNameOpts?: { config?: AxiosRequestConfig }): Observable>; + public getUserByName(username: string, getUserByNameOpts?: { config?: AxiosRequestConfig }): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling getUserByName.'); } @@ -292,7 +301,8 @@ export class UserService { return this.httpClient.get(`${this.basePath}/user/${encodeURIComponent(String(username))}`, { withCredentials: this.configuration.withCredentials, - headers: headers + ...getUserByNameOpts?.config, + headers: {...headers, ...getUserByNameOpts?.config?.headers}, } ); }) @@ -305,9 +315,10 @@ export class UserService { * @param password The password for login in clear text * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. + * @param {*} [loginUserOpts.config] Override http request option. */ - public loginUser(username: string, password: string, ): Observable>; - public loginUser(username: string, password: string, ): Observable { + public loginUser(username: string, password: string, loginUserOpts?: { config?: AxiosRequestConfig }): Observable>; + public loginUser(username: string, password: string, loginUserOpts?: { config?: AxiosRequestConfig }): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling loginUser.'); } @@ -351,7 +362,8 @@ export class UserService { { params: queryParameters, withCredentials: this.configuration.withCredentials, - headers: headers + ...loginUserOpts?.config, + headers: {...headers, ...loginUserOpts?.config?.headers}, } ); }) @@ -362,9 +374,10 @@ export class UserService { * * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. + * @param {*} [logoutUserOpts.config] Override http request option. */ - public logoutUser(): Observable>; - public logoutUser(): Observable { + public logoutUser(logoutUserOpts?: { config?: AxiosRequestConfig }): Observable>; + public logoutUser(logoutUserOpts?: { config?: AxiosRequestConfig }): Observable { let headers = {...this.defaultHeaders}; let accessTokenObservable: Observable = of(null); @@ -394,7 +407,8 @@ export class UserService { return this.httpClient.get(`${this.basePath}/user/logout`, { withCredentials: this.configuration.withCredentials, - headers: headers + ...logoutUserOpts?.config, + headers: {...headers, ...logoutUserOpts?.config?.headers}, } ); }) @@ -407,9 +421,10 @@ export class UserService { * @param user Updated user object * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. + * @param {*} [updateUserOpts.config] Override http request option. */ - public updateUser(username: string, user: User, ): Observable>; - public updateUser(username: string, user: User, ): Observable { + public updateUser(username: string, user: User, updateUserOpts?: { config?: AxiosRequestConfig }): Observable>; + public updateUser(username: string, user: User, updateUserOpts?: { config?: AxiosRequestConfig }): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling updateUser.'); } @@ -453,7 +468,8 @@ export class UserService { user, { withCredentials: this.configuration.withCredentials, - headers: headers + ...updateUserOpts?.config, + headers: {...headers, ...updateUserOpts?.config?.headers}, } ); }) diff --git a/samples/client/petstore/typescript-nestjs/builds/reservedParamNames/api/default.service.ts b/samples/client/petstore/typescript-nestjs/builds/reservedParamNames/api/default.service.ts index c41aa37ec06..4741970ee3f 100644 --- a/samples/client/petstore/typescript-nestjs/builds/reservedParamNames/api/default.service.ts +++ b/samples/client/petstore/typescript-nestjs/builds/reservedParamNames/api/default.service.ts @@ -13,7 +13,7 @@ import { Injectable, Optional } from '@nestjs/common'; import { HttpService } from '@nestjs/axios'; -import { AxiosResponse } from 'axios'; +import type { AxiosRequestConfig, AxiosResponse } from 'axios'; import { Observable, from, of, switchMap } from 'rxjs'; import { Configuration } from '../configuration'; import { COLLECTION_FORMATS } from '../variables'; @@ -74,9 +74,10 @@ export class DefaultService { * Test reserved param names * * @param {DefaultServiceTestReservedParamNamesRequest} requestParameters Request parameters. + * @param {*} [testReservedParamNamesOpts.config] Override http request option. */ - public testReservedParamNames(requestParameters: DefaultServiceTestReservedParamNamesRequest, ): Observable>; - public testReservedParamNames(requestParameters: DefaultServiceTestReservedParamNamesRequest, ): Observable { + public testReservedParamNames(requestParameters: DefaultServiceTestReservedParamNamesRequest, testReservedParamNamesOpts?: { config?: AxiosRequestConfig }): Observable>; + public testReservedParamNames(requestParameters: DefaultServiceTestReservedParamNamesRequest, testReservedParamNamesOpts?: { config?: AxiosRequestConfig }): Observable { const { notReserved, 'from': _from, @@ -138,7 +139,8 @@ export class DefaultService { { params: queryParameters, withCredentials: this.configuration.withCredentials, - headers: headers + ...testReservedParamNamesOpts?.config, + headers: {...headers, ...testReservedParamNamesOpts?.config?.headers}, } ); })