From cc5793677b449c72e4be5794d18d8d554085dc74 Mon Sep 17 00:00:00 2001 From: Gregory Merlet Date: Mon, 2 Dec 2024 17:31:29 +0100 Subject: [PATCH 1/7] feat: add options to service functions --- .../typescript-nestjs/api.service.mustache | 14 ++-- .../builds/default/api/pet.service.ts | 66 ++++++++++++------- .../builds/default/api/store.service.ts | 34 ++++++---- .../builds/default/api/user.service.ts | 66 ++++++++++++------- .../builds/default/api/pet.service.ts | 66 ++++++++++++------- .../builds/default/api/store.service.ts | 34 ++++++---- .../builds/default/api/user.service.ts | 66 ++++++++++++------- 7 files changed, 214 insertions(+), 132 deletions(-) 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 12bf8d238860..d89cd3af49b5 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 { AxiosResponse, RawAxiosRequestConfig } 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 {*} [options] 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}}options?: RawAxiosRequestConfig): Observable>; + public {{nickname}}({{#allParams.0}}requestParameters: {{classname}}{{operationIdCamelCase}}Request, {{/allParams.0}}options?: RawAxiosRequestConfig): 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}}options?: RawAxiosRequestConfig): Observable>; + public {{nickname}}({{#allParams}}{{^isConstEnumParam}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/isConstEnumParam}}{{/allParams}}options?: RawAxiosRequestConfig): Observable { {{/useSingleRequestParameter}} {{#allParams.0}} {{#useSingleRequestParameter}} @@ -291,7 +292,8 @@ export class {{classname}} { responseType: "blob", {{/isResponseFile}} withCredentials: this.configuration.withCredentials, - headers: headers + headers: {...headers, ...options?.headers}, + ...options, } ); }) 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 1f0ae5010dad..315c53475462 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 { AxiosResponse, RawAxiosRequestConfig } 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 {*} [options] Override http request option. */ - public addPet(pet: Pet, ): Observable>; - public addPet(pet: Pet, ): Observable { + public addPet(pet: Pet, options?: RawAxiosRequestConfig): Observable>; + public addPet(pet: Pet, options?: RawAxiosRequestConfig): 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 + headers: {...headers, ...options?.headers}, + ...options, } ); }) @@ -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 {*} [options] Override http request option. */ - public deletePet(petId: number, apiKey?: string, ): Observable>; - public deletePet(petId: number, apiKey?: string, ): Observable { + public deletePet(petId: number, apiKey?: string, options?: RawAxiosRequestConfig): Observable>; + public deletePet(petId: number, apiKey?: string, options?: RawAxiosRequestConfig): 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 + headers: {...headers, ...options?.headers}, + ...options, } ); }) @@ -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 {*} [options] 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'>, options?: RawAxiosRequestConfig): Observable>>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: RawAxiosRequestConfig): 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 + headers: {...headers, ...options?.headers}, + ...options, } ); }) @@ -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 {*} [options] Override http request option. */ - public findPetsByTags(tags: Array, ): Observable>>; - public findPetsByTags(tags: Array, ): Observable { + public findPetsByTags(tags: Array, options?: RawAxiosRequestConfig): Observable>>; + public findPetsByTags(tags: Array, options?: RawAxiosRequestConfig): 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 + headers: {...headers, ...options?.headers}, + ...options, } ); }) @@ -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 {*} [options] Override http request option. */ - public getPetById(petId: number, ): Observable>; - public getPetById(petId: number, ): Observable { + public getPetById(petId: number, options?: RawAxiosRequestConfig): Observable>; + public getPetById(petId: number, options?: RawAxiosRequestConfig): 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 + headers: {...headers, ...options?.headers}, + ...options, } ); }) @@ -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 {*} [options] Override http request option. */ - public updatePet(pet: Pet, ): Observable>; - public updatePet(pet: Pet, ): Observable { + public updatePet(pet: Pet, options?: RawAxiosRequestConfig): Observable>; + public updatePet(pet: Pet, options?: RawAxiosRequestConfig): 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 + headers: {...headers, ...options?.headers}, + ...options, } ); }) @@ -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 {*} [options] 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, options?: RawAxiosRequestConfig): Observable>; + public updatePetWithForm(petId: number, name?: string, status?: string, options?: RawAxiosRequestConfig): 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 + headers: {...headers, ...options?.headers}, + ...options, } ); }) @@ -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 {*} [options] 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, options?: RawAxiosRequestConfig): Observable>; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, options?: RawAxiosRequestConfig): 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 + headers: {...headers, ...options?.headers}, + ...options, } ); }) 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 94297bee3061..38b1e45373b8 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 { AxiosResponse, RawAxiosRequestConfig } 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 {*} [options] Override http request option. */ - public deleteOrder(orderId: string, ): Observable>; - public deleteOrder(orderId: string, ): Observable { + public deleteOrder(orderId: string, options?: RawAxiosRequestConfig): Observable>; + public deleteOrder(orderId: string, options?: RawAxiosRequestConfig): 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 + headers: {...headers, ...options?.headers}, + ...options, } ); }) @@ -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 {*} [options] Override http request option. */ - public getInventory(): Observable>; - public getInventory(): Observable { + public getInventory(options?: RawAxiosRequestConfig): Observable>; + public getInventory(options?: RawAxiosRequestConfig): 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 + headers: {...headers, ...options?.headers}, + ...options, } ); }) @@ -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 {*} [options] Override http request option. */ - public getOrderById(orderId: number, ): Observable>; - public getOrderById(orderId: number, ): Observable { + public getOrderById(orderId: number, options?: RawAxiosRequestConfig): Observable>; + public getOrderById(orderId: number, options?: RawAxiosRequestConfig): 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 + headers: {...headers, ...options?.headers}, + ...options, } ); }) @@ -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 {*} [options] Override http request option. */ - public placeOrder(order: Order, ): Observable>; - public placeOrder(order: Order, ): Observable { + public placeOrder(order: Order, options?: RawAxiosRequestConfig): Observable>; + public placeOrder(order: Order, options?: RawAxiosRequestConfig): 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 + headers: {...headers, ...options?.headers}, + ...options, } ); }) 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 ab3450300f76..428658de11cd 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 { AxiosResponse, RawAxiosRequestConfig } 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 {*} [options] Override http request option. */ - public createUser(user: User, ): Observable>; - public createUser(user: User, ): Observable { + public createUser(user: User, options?: RawAxiosRequestConfig): Observable>; + public createUser(user: User, options?: RawAxiosRequestConfig): 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 + headers: {...headers, ...options?.headers}, + ...options, } ); }) @@ -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 {*} [options] Override http request option. */ - public createUsersWithArrayInput(user: Array, ): Observable>; - public createUsersWithArrayInput(user: Array, ): Observable { + public createUsersWithArrayInput(user: Array, options?: RawAxiosRequestConfig): Observable>; + public createUsersWithArrayInput(user: Array, options?: RawAxiosRequestConfig): 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 + headers: {...headers, ...options?.headers}, + ...options, } ); }) @@ -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 {*} [options] Override http request option. */ - public createUsersWithListInput(user: Array, ): Observable>; - public createUsersWithListInput(user: Array, ): Observable { + public createUsersWithListInput(user: Array, options?: RawAxiosRequestConfig): Observable>; + public createUsersWithListInput(user: Array, options?: RawAxiosRequestConfig): 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 + headers: {...headers, ...options?.headers}, + ...options, } ); }) @@ -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 {*} [options] Override http request option. */ - public deleteUser(username: string, ): Observable>; - public deleteUser(username: string, ): Observable { + public deleteUser(username: string, options?: RawAxiosRequestConfig): Observable>; + public deleteUser(username: string, options?: RawAxiosRequestConfig): 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 + headers: {...headers, ...options?.headers}, + ...options, } ); }) @@ -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 {*} [options] Override http request option. */ - public getUserByName(username: string, ): Observable>; - public getUserByName(username: string, ): Observable { + public getUserByName(username: string, options?: RawAxiosRequestConfig): Observable>; + public getUserByName(username: string, options?: RawAxiosRequestConfig): 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 + headers: {...headers, ...options?.headers}, + ...options, } ); }) @@ -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 {*} [options] Override http request option. */ - public loginUser(username: string, password: string, ): Observable>; - public loginUser(username: string, password: string, ): Observable { + public loginUser(username: string, password: string, options?: RawAxiosRequestConfig): Observable>; + public loginUser(username: string, password: string, options?: RawAxiosRequestConfig): 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 + headers: {...headers, ...options?.headers}, + ...options, } ); }) @@ -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 {*} [options] Override http request option. */ - public logoutUser(): Observable>; - public logoutUser(): Observable { + public logoutUser(options?: RawAxiosRequestConfig): Observable>; + public logoutUser(options?: RawAxiosRequestConfig): 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 + headers: {...headers, ...options?.headers}, + ...options, } ); }) @@ -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 {*} [options] Override http request option. */ - public updateUser(username: string, user: User, ): Observable>; - public updateUser(username: string, user: User, ): Observable { + public updateUser(username: string, user: User, options?: RawAxiosRequestConfig): Observable>; + public updateUser(username: string, user: User, options?: RawAxiosRequestConfig): 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 + headers: {...headers, ...options?.headers}, + ...options, } ); }) 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 5f68577397a0..5f2f28a00829 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 { AxiosResponse, RawAxiosRequestConfig } 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 {*} [options] Override http request option. */ - public addPet(pet: Pet, ): Observable>; - public addPet(pet: Pet, ): Observable { + public addPet(pet: Pet, options?: RawAxiosRequestConfig): Observable>; + public addPet(pet: Pet, options?: RawAxiosRequestConfig): 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 + headers: {...headers, ...options?.headers}, + ...options, } ); }) @@ -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 {*} [options] Override http request option. */ - public deletePet(petId: number, apiKey?: string, ): Observable>; - public deletePet(petId: number, apiKey?: string, ): Observable { + public deletePet(petId: number, apiKey?: string, options?: RawAxiosRequestConfig): Observable>; + public deletePet(petId: number, apiKey?: string, options?: RawAxiosRequestConfig): 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 + headers: {...headers, ...options?.headers}, + ...options, } ); }) @@ -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 {*} [options] 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'>, options?: RawAxiosRequestConfig): Observable>>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: RawAxiosRequestConfig): 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 + headers: {...headers, ...options?.headers}, + ...options, } ); }) @@ -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 {*} [options] Override http request option. */ - public findPetsByTags(tags: Array, ): Observable>>; - public findPetsByTags(tags: Array, ): Observable { + public findPetsByTags(tags: Array, options?: RawAxiosRequestConfig): Observable>>; + public findPetsByTags(tags: Array, options?: RawAxiosRequestConfig): 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 + headers: {...headers, ...options?.headers}, + ...options, } ); }) @@ -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 {*} [options] Override http request option. */ - public getPetById(petId: number, ): Observable>; - public getPetById(petId: number, ): Observable { + public getPetById(petId: number, options?: RawAxiosRequestConfig): Observable>; + public getPetById(petId: number, options?: RawAxiosRequestConfig): 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 + headers: {...headers, ...options?.headers}, + ...options, } ); }) @@ -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 {*} [options] Override http request option. */ - public updatePet(pet: Pet, ): Observable>; - public updatePet(pet: Pet, ): Observable { + public updatePet(pet: Pet, options?: RawAxiosRequestConfig): Observable>; + public updatePet(pet: Pet, options?: RawAxiosRequestConfig): 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 + headers: {...headers, ...options?.headers}, + ...options, } ); }) @@ -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 {*} [options] 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, options?: RawAxiosRequestConfig): Observable>; + public updatePetWithForm(petId: number, name?: string, status?: string, options?: RawAxiosRequestConfig): 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 + headers: {...headers, ...options?.headers}, + ...options, } ); }) @@ -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 {*} [options] 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, options?: RawAxiosRequestConfig): Observable>; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, options?: RawAxiosRequestConfig): 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 + headers: {...headers, ...options?.headers}, + ...options, } ); }) 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 72e0006fcb76..a52ad362ca82 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 { AxiosResponse, RawAxiosRequestConfig } 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 {*} [options] Override http request option. */ - public deleteOrder(orderId: string, ): Observable>; - public deleteOrder(orderId: string, ): Observable { + public deleteOrder(orderId: string, options?: RawAxiosRequestConfig): Observable>; + public deleteOrder(orderId: string, options?: RawAxiosRequestConfig): 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 + headers: {...headers, ...options?.headers}, + ...options, } ); }) @@ -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 {*} [options] Override http request option. */ - public getInventory(): Observable>; - public getInventory(): Observable { + public getInventory(options?: RawAxiosRequestConfig): Observable>; + public getInventory(options?: RawAxiosRequestConfig): 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 + headers: {...headers, ...options?.headers}, + ...options, } ); }) @@ -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 {*} [options] Override http request option. */ - public getOrderById(orderId: number, ): Observable>; - public getOrderById(orderId: number, ): Observable { + public getOrderById(orderId: number, options?: RawAxiosRequestConfig): Observable>; + public getOrderById(orderId: number, options?: RawAxiosRequestConfig): 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 + headers: {...headers, ...options?.headers}, + ...options, } ); }) @@ -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 {*} [options] Override http request option. */ - public placeOrder(order: Order, ): Observable>; - public placeOrder(order: Order, ): Observable { + public placeOrder(order: Order, options?: RawAxiosRequestConfig): Observable>; + public placeOrder(order: Order, options?: RawAxiosRequestConfig): 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 + headers: {...headers, ...options?.headers}, + ...options, } ); }) 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 d55838c23a13..43cc58348a63 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 { AxiosResponse, RawAxiosRequestConfig } 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 {*} [options] Override http request option. */ - public createUser(user: User, ): Observable>; - public createUser(user: User, ): Observable { + public createUser(user: User, options?: RawAxiosRequestConfig): Observable>; + public createUser(user: User, options?: RawAxiosRequestConfig): 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 + headers: {...headers, ...options?.headers}, + ...options, } ); }) @@ -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 {*} [options] Override http request option. */ - public createUsersWithArrayInput(user: Array, ): Observable>; - public createUsersWithArrayInput(user: Array, ): Observable { + public createUsersWithArrayInput(user: Array, options?: RawAxiosRequestConfig): Observable>; + public createUsersWithArrayInput(user: Array, options?: RawAxiosRequestConfig): 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 + headers: {...headers, ...options?.headers}, + ...options, } ); }) @@ -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 {*} [options] Override http request option. */ - public createUsersWithListInput(user: Array, ): Observable>; - public createUsersWithListInput(user: Array, ): Observable { + public createUsersWithListInput(user: Array, options?: RawAxiosRequestConfig): Observable>; + public createUsersWithListInput(user: Array, options?: RawAxiosRequestConfig): 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 + headers: {...headers, ...options?.headers}, + ...options, } ); }) @@ -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 {*} [options] Override http request option. */ - public deleteUser(username: string, ): Observable>; - public deleteUser(username: string, ): Observable { + public deleteUser(username: string, options?: RawAxiosRequestConfig): Observable>; + public deleteUser(username: string, options?: RawAxiosRequestConfig): 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 + headers: {...headers, ...options?.headers}, + ...options, } ); }) @@ -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 {*} [options] Override http request option. */ - public getUserByName(username: string, ): Observable>; - public getUserByName(username: string, ): Observable { + public getUserByName(username: string, options?: RawAxiosRequestConfig): Observable>; + public getUserByName(username: string, options?: RawAxiosRequestConfig): 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 + headers: {...headers, ...options?.headers}, + ...options, } ); }) @@ -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 {*} [options] Override http request option. */ - public loginUser(username: string, password: string, ): Observable>; - public loginUser(username: string, password: string, ): Observable { + public loginUser(username: string, password: string, options?: RawAxiosRequestConfig): Observable>; + public loginUser(username: string, password: string, options?: RawAxiosRequestConfig): 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 + headers: {...headers, ...options?.headers}, + ...options, } ); }) @@ -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 {*} [options] Override http request option. */ - public logoutUser(): Observable>; - public logoutUser(): Observable { + public logoutUser(options?: RawAxiosRequestConfig): Observable>; + public logoutUser(options?: RawAxiosRequestConfig): 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 + headers: {...headers, ...options?.headers}, + ...options, } ); }) @@ -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 {*} [options] Override http request option. */ - public updateUser(username: string, user: User, ): Observable>; - public updateUser(username: string, user: User, ): Observable { + public updateUser(username: string, user: User, options?: RawAxiosRequestConfig): Observable>; + public updateUser(username: string, user: User, options?: RawAxiosRequestConfig): 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 + headers: {...headers, ...options?.headers}, + ...options, } ); }) From 8bb7982d01adb06e8a92bb6bc7b56622a872ff34 Mon Sep 17 00:00:00 2001 From: Gregory Merlet Date: Mon, 2 Dec 2024 17:54:25 +0100 Subject: [PATCH 2/7] fix: fix type error --- .../typescript-nestjs/api.service.mustache | 10 +++--- .../builds/default/api/pet.service.ts | 34 +++++++++---------- .../builds/default/api/store.service.ts | 18 +++++----- .../builds/default/api/user.service.ts | 34 +++++++++---------- .../builds/default/api/pet.service.ts | 34 +++++++++---------- .../builds/default/api/store.service.ts | 18 +++++----- .../builds/default/api/user.service.ts | 34 +++++++++---------- 7 files changed, 91 insertions(+), 91 deletions(-) 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 d89cd3af49b5..ac6fba81936b 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, RawAxiosRequestConfig } from 'axios'; +import { AxiosRequestConfig, AxiosResponse } from 'axios'; import { Observable, from, of, switchMap } from 'rxjs'; {{#imports}} import { {{classname}} } from '../{{filename}}'; @@ -96,12 +96,12 @@ export class {{classname}} { * @param {*} [options] Override http request option. */ {{#useSingleRequestParameter}} - public {{nickname}}({{#allParams.0}}requestParameters: {{classname}}{{operationIdCamelCase}}Request, {{/allParams.0}}options?: RawAxiosRequestConfig): Observable>; - public {{nickname}}({{#allParams.0}}requestParameters: {{classname}}{{operationIdCamelCase}}Request, {{/allParams.0}}options?: RawAxiosRequestConfig): Observable { + public {{nickname}}({{#allParams.0}}requestParameters: {{classname}}{{operationIdCamelCase}}Request, {{/allParams.0}}options?: AxiosRequestConfig): Observable>; + public {{nickname}}({{#allParams.0}}requestParameters: {{classname}}{{operationIdCamelCase}}Request, {{/allParams.0}}options?: AxiosRequestConfig): Observable { {{/useSingleRequestParameter}} {{^useSingleRequestParameter}} - public {{nickname}}({{#allParams}}{{^isConstEnumParam}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/isConstEnumParam}}{{/allParams}}options?: RawAxiosRequestConfig): Observable>; - public {{nickname}}({{#allParams}}{{^isConstEnumParam}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/isConstEnumParam}}{{/allParams}}options?: RawAxiosRequestConfig): Observable { + public {{nickname}}({{#allParams}}{{^isConstEnumParam}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/isConstEnumParam}}{{/allParams}}options?: AxiosRequestConfig): Observable>; + public {{nickname}}({{#allParams}}{{^isConstEnumParam}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/isConstEnumParam}}{{/allParams}}options?: AxiosRequestConfig): Observable { {{/useSingleRequestParameter}} {{#allParams.0}} {{#useSingleRequestParameter}} 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 315c53475462..69191977a2a0 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, RawAxiosRequestConfig } from 'axios'; +import { AxiosRequestConfig, AxiosResponse } from 'axios'; import { Observable, from, of, switchMap } from 'rxjs'; import { ApiResponse } from '../model/apiResponse'; import { Pet } from '../model/pet'; @@ -51,8 +51,8 @@ export class PetService { * @param reportProgress flag to report request and response progress. * @param {*} [options] Override http request option. */ - public addPet(pet: Pet, options?: RawAxiosRequestConfig): Observable>; - public addPet(pet: Pet, options?: RawAxiosRequestConfig): Observable { + public addPet(pet: Pet, options?: AxiosRequestConfig): Observable>; + public addPet(pet: Pet, options?: AxiosRequestConfig): Observable { if (pet === null || pet === undefined) { throw new Error('Required parameter pet was null or undefined when calling addPet.'); } @@ -113,8 +113,8 @@ export class PetService { * @param reportProgress flag to report request and response progress. * @param {*} [options] Override http request option. */ - public deletePet(petId: number, apiKey?: string, options?: RawAxiosRequestConfig): Observable>; - public deletePet(petId: number, apiKey?: string, options?: RawAxiosRequestConfig): Observable { + public deletePet(petId: number, apiKey?: string, options?: AxiosRequestConfig): Observable>; + public deletePet(petId: number, apiKey?: string, options?: AxiosRequestConfig): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling deletePet.'); } @@ -168,8 +168,8 @@ export class PetService { * @param reportProgress flag to report request and response progress. * @param {*} [options] Override http request option. */ - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: RawAxiosRequestConfig): Observable>>; - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: RawAxiosRequestConfig): Observable { + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: AxiosRequestConfig): Observable>>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: AxiosRequestConfig): Observable { if (status === null || status === undefined) { throw new Error('Required parameter status was null or undefined when calling findPetsByStatus.'); } @@ -228,8 +228,8 @@ export class PetService { * @param reportProgress flag to report request and response progress. * @param {*} [options] Override http request option. */ - public findPetsByTags(tags: Array, options?: RawAxiosRequestConfig): Observable>>; - public findPetsByTags(tags: Array, options?: RawAxiosRequestConfig): Observable { + public findPetsByTags(tags: Array, options?: AxiosRequestConfig): Observable>>; + public findPetsByTags(tags: Array, options?: AxiosRequestConfig): Observable { if (tags === null || tags === undefined) { throw new Error('Required parameter tags was null or undefined when calling findPetsByTags.'); } @@ -288,8 +288,8 @@ export class PetService { * @param reportProgress flag to report request and response progress. * @param {*} [options] Override http request option. */ - public getPetById(petId: number, options?: RawAxiosRequestConfig): Observable>; - public getPetById(petId: number, options?: RawAxiosRequestConfig): Observable { + public getPetById(petId: number, options?: AxiosRequestConfig): Observable>; + public getPetById(petId: number, options?: AxiosRequestConfig): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling getPetById.'); } @@ -340,8 +340,8 @@ export class PetService { * @param reportProgress flag to report request and response progress. * @param {*} [options] Override http request option. */ - public updatePet(pet: Pet, options?: RawAxiosRequestConfig): Observable>; - public updatePet(pet: Pet, options?: RawAxiosRequestConfig): Observable { + public updatePet(pet: Pet, options?: AxiosRequestConfig): Observable>; + public updatePet(pet: Pet, options?: AxiosRequestConfig): Observable { if (pet === null || pet === undefined) { throw new Error('Required parameter pet was null or undefined when calling updatePet.'); } @@ -403,8 +403,8 @@ export class PetService { * @param reportProgress flag to report request and response progress. * @param {*} [options] Override http request option. */ - public updatePetWithForm(petId: number, name?: string, status?: string, options?: RawAxiosRequestConfig): Observable>; - public updatePetWithForm(petId: number, name?: string, status?: string, options?: RawAxiosRequestConfig): Observable { + public updatePetWithForm(petId: number, name?: string, status?: string, options?: AxiosRequestConfig): Observable>; + public updatePetWithForm(petId: number, name?: string, status?: string, options?: AxiosRequestConfig): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling updatePetWithForm.'); } @@ -479,8 +479,8 @@ export class PetService { * @param reportProgress flag to report request and response progress. * @param {*} [options] Override http request option. */ - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, options?: RawAxiosRequestConfig): Observable>; - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, options?: RawAxiosRequestConfig): Observable { + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, options?: AxiosRequestConfig): Observable>; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, options?: AxiosRequestConfig): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling uploadFile.'); } 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 38b1e45373b8..5660510c6e2f 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, RawAxiosRequestConfig } from 'axios'; +import { AxiosRequestConfig, AxiosResponse } from 'axios'; import { Observable, from, of, switchMap } from 'rxjs'; import { Order } from '../model/order'; import { Configuration } from '../configuration'; @@ -50,8 +50,8 @@ export class StoreService { * @param reportProgress flag to report request and response progress. * @param {*} [options] Override http request option. */ - public deleteOrder(orderId: string, options?: RawAxiosRequestConfig): Observable>; - public deleteOrder(orderId: string, options?: RawAxiosRequestConfig): Observable { + public deleteOrder(orderId: string, options?: AxiosRequestConfig): Observable>; + public deleteOrder(orderId: string, options?: AxiosRequestConfig): Observable { if (orderId === null || orderId === undefined) { throw new Error('Required parameter orderId was null or undefined when calling deleteOrder.'); } @@ -94,8 +94,8 @@ export class StoreService { * @param reportProgress flag to report request and response progress. * @param {*} [options] Override http request option. */ - public getInventory(options?: RawAxiosRequestConfig): Observable>; - public getInventory(options?: RawAxiosRequestConfig): Observable { + public getInventory(options?: AxiosRequestConfig): Observable>; + public getInventory(options?: AxiosRequestConfig): Observable { let headers = {...this.defaultHeaders}; let accessTokenObservable: Observable = of(null); @@ -141,8 +141,8 @@ export class StoreService { * @param reportProgress flag to report request and response progress. * @param {*} [options] Override http request option. */ - public getOrderById(orderId: number, options?: RawAxiosRequestConfig): Observable>; - public getOrderById(orderId: number, options?: RawAxiosRequestConfig): Observable { + public getOrderById(orderId: number, options?: AxiosRequestConfig): Observable>; + public getOrderById(orderId: number, options?: AxiosRequestConfig): Observable { if (orderId === null || orderId === undefined) { throw new Error('Required parameter orderId was null or undefined when calling getOrderById.'); } @@ -188,8 +188,8 @@ export class StoreService { * @param reportProgress flag to report request and response progress. * @param {*} [options] Override http request option. */ - public placeOrder(order: Order, options?: RawAxiosRequestConfig): Observable>; - public placeOrder(order: Order, options?: RawAxiosRequestConfig): Observable { + public placeOrder(order: Order, options?: AxiosRequestConfig): Observable>; + public placeOrder(order: Order, options?: AxiosRequestConfig): Observable { if (order === null || order === undefined) { throw new Error('Required parameter order was null or undefined when calling placeOrder.'); } 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 428658de11cd..81925ba55571 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, RawAxiosRequestConfig } from 'axios'; +import { AxiosRequestConfig, AxiosResponse } from 'axios'; import { Observable, from, of, switchMap } from 'rxjs'; import { User } from '../model/user'; import { Configuration } from '../configuration'; @@ -50,8 +50,8 @@ export class UserService { * @param reportProgress flag to report request and response progress. * @param {*} [options] Override http request option. */ - public createUser(user: User, options?: RawAxiosRequestConfig): Observable>; - public createUser(user: User, options?: RawAxiosRequestConfig): Observable { + public createUser(user: User, options?: AxiosRequestConfig): Observable>; + public createUser(user: User, options?: AxiosRequestConfig): Observable { if (user === null || user === undefined) { throw new Error('Required parameter user was null or undefined when calling createUser.'); } @@ -106,8 +106,8 @@ export class UserService { * @param reportProgress flag to report request and response progress. * @param {*} [options] Override http request option. */ - public createUsersWithArrayInput(user: Array, options?: RawAxiosRequestConfig): Observable>; - public createUsersWithArrayInput(user: Array, options?: RawAxiosRequestConfig): Observable { + public createUsersWithArrayInput(user: Array, options?: AxiosRequestConfig): Observable>; + public createUsersWithArrayInput(user: Array, options?: AxiosRequestConfig): Observable { if (user === null || user === undefined) { throw new Error('Required parameter user was null or undefined when calling createUsersWithArrayInput.'); } @@ -162,8 +162,8 @@ export class UserService { * @param reportProgress flag to report request and response progress. * @param {*} [options] Override http request option. */ - public createUsersWithListInput(user: Array, options?: RawAxiosRequestConfig): Observable>; - public createUsersWithListInput(user: Array, options?: RawAxiosRequestConfig): Observable { + public createUsersWithListInput(user: Array, options?: AxiosRequestConfig): Observable>; + public createUsersWithListInput(user: Array, options?: AxiosRequestConfig): Observable { if (user === null || user === undefined) { throw new Error('Required parameter user was null or undefined when calling createUsersWithListInput.'); } @@ -218,8 +218,8 @@ export class UserService { * @param reportProgress flag to report request and response progress. * @param {*} [options] Override http request option. */ - public deleteUser(username: string, options?: RawAxiosRequestConfig): Observable>; - public deleteUser(username: string, options?: RawAxiosRequestConfig): Observable { + public deleteUser(username: string, options?: AxiosRequestConfig): Observable>; + public deleteUser(username: string, options?: AxiosRequestConfig): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling deleteUser.'); } @@ -268,8 +268,8 @@ export class UserService { * @param reportProgress flag to report request and response progress. * @param {*} [options] Override http request option. */ - public getUserByName(username: string, options?: RawAxiosRequestConfig): Observable>; - public getUserByName(username: string, options?: RawAxiosRequestConfig): Observable { + public getUserByName(username: string, options?: AxiosRequestConfig): Observable>; + public getUserByName(username: string, options?: AxiosRequestConfig): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling getUserByName.'); } @@ -316,8 +316,8 @@ export class UserService { * @param reportProgress flag to report request and response progress. * @param {*} [options] Override http request option. */ - public loginUser(username: string, password: string, options?: RawAxiosRequestConfig): Observable>; - public loginUser(username: string, password: string, options?: RawAxiosRequestConfig): Observable { + public loginUser(username: string, password: string, options?: AxiosRequestConfig): Observable>; + public loginUser(username: string, password: string, options?: AxiosRequestConfig): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling loginUser.'); } @@ -375,8 +375,8 @@ export class UserService { * @param reportProgress flag to report request and response progress. * @param {*} [options] Override http request option. */ - public logoutUser(options?: RawAxiosRequestConfig): Observable>; - public logoutUser(options?: RawAxiosRequestConfig): Observable { + public logoutUser(options?: AxiosRequestConfig): Observable>; + public logoutUser(options?: AxiosRequestConfig): Observable { let headers = {...this.defaultHeaders}; let accessTokenObservable: Observable = of(null); @@ -422,8 +422,8 @@ export class UserService { * @param reportProgress flag to report request and response progress. * @param {*} [options] Override http request option. */ - public updateUser(username: string, user: User, options?: RawAxiosRequestConfig): Observable>; - public updateUser(username: string, user: User, options?: RawAxiosRequestConfig): Observable { + public updateUser(username: string, user: User, options?: AxiosRequestConfig): Observable>; + public updateUser(username: string, user: User, options?: AxiosRequestConfig): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling updateUser.'); } 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 5f2f28a00829..66881b7c6f5f 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, RawAxiosRequestConfig } from 'axios'; +import { AxiosRequestConfig, AxiosResponse } from 'axios'; import { Observable, from, of, switchMap } from 'rxjs'; import { ApiResponse } from '../model/apiResponse'; import { Pet } from '../model/pet'; @@ -52,8 +52,8 @@ export class PetService { * @param reportProgress flag to report request and response progress. * @param {*} [options] Override http request option. */ - public addPet(pet: Pet, options?: RawAxiosRequestConfig): Observable>; - public addPet(pet: Pet, options?: RawAxiosRequestConfig): Observable { + public addPet(pet: Pet, options?: AxiosRequestConfig): Observable>; + public addPet(pet: Pet, options?: AxiosRequestConfig): Observable { if (pet === null || pet === undefined) { throw new Error('Required parameter pet was null or undefined when calling addPet.'); } @@ -114,8 +114,8 @@ export class PetService { * @param reportProgress flag to report request and response progress. * @param {*} [options] Override http request option. */ - public deletePet(petId: number, apiKey?: string, options?: RawAxiosRequestConfig): Observable>; - public deletePet(petId: number, apiKey?: string, options?: RawAxiosRequestConfig): Observable { + public deletePet(petId: number, apiKey?: string, options?: AxiosRequestConfig): Observable>; + public deletePet(petId: number, apiKey?: string, options?: AxiosRequestConfig): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling deletePet.'); } @@ -169,8 +169,8 @@ export class PetService { * @param reportProgress flag to report request and response progress. * @param {*} [options] Override http request option. */ - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: RawAxiosRequestConfig): Observable>>; - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: RawAxiosRequestConfig): Observable { + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: AxiosRequestConfig): Observable>>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: AxiosRequestConfig): Observable { if (status === null || status === undefined) { throw new Error('Required parameter status was null or undefined when calling findPetsByStatus.'); } @@ -229,8 +229,8 @@ export class PetService { * @param reportProgress flag to report request and response progress. * @param {*} [options] Override http request option. */ - public findPetsByTags(tags: Array, options?: RawAxiosRequestConfig): Observable>>; - public findPetsByTags(tags: Array, options?: RawAxiosRequestConfig): Observable { + public findPetsByTags(tags: Array, options?: AxiosRequestConfig): Observable>>; + public findPetsByTags(tags: Array, options?: AxiosRequestConfig): Observable { if (tags === null || tags === undefined) { throw new Error('Required parameter tags was null or undefined when calling findPetsByTags.'); } @@ -289,8 +289,8 @@ export class PetService { * @param reportProgress flag to report request and response progress. * @param {*} [options] Override http request option. */ - public getPetById(petId: number, options?: RawAxiosRequestConfig): Observable>; - public getPetById(petId: number, options?: RawAxiosRequestConfig): Observable { + public getPetById(petId: number, options?: AxiosRequestConfig): Observable>; + public getPetById(petId: number, options?: AxiosRequestConfig): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling getPetById.'); } @@ -341,8 +341,8 @@ export class PetService { * @param reportProgress flag to report request and response progress. * @param {*} [options] Override http request option. */ - public updatePet(pet: Pet, options?: RawAxiosRequestConfig): Observable>; - public updatePet(pet: Pet, options?: RawAxiosRequestConfig): Observable { + public updatePet(pet: Pet, options?: AxiosRequestConfig): Observable>; + public updatePet(pet: Pet, options?: AxiosRequestConfig): Observable { if (pet === null || pet === undefined) { throw new Error('Required parameter pet was null or undefined when calling updatePet.'); } @@ -404,8 +404,8 @@ export class PetService { * @param reportProgress flag to report request and response progress. * @param {*} [options] Override http request option. */ - public updatePetWithForm(petId: number, name?: string, status?: string, options?: RawAxiosRequestConfig): Observable>; - public updatePetWithForm(petId: number, name?: string, status?: string, options?: RawAxiosRequestConfig): Observable { + public updatePetWithForm(petId: number, name?: string, status?: string, options?: AxiosRequestConfig): Observable>; + public updatePetWithForm(petId: number, name?: string, status?: string, options?: AxiosRequestConfig): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling updatePetWithForm.'); } @@ -480,8 +480,8 @@ export class PetService { * @param reportProgress flag to report request and response progress. * @param {*} [options] Override http request option. */ - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, options?: RawAxiosRequestConfig): Observable>; - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, options?: RawAxiosRequestConfig): Observable { + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, options?: AxiosRequestConfig): Observable>; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, options?: AxiosRequestConfig): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling uploadFile.'); } 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 a52ad362ca82..b0fad97c5fc3 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, RawAxiosRequestConfig } from 'axios'; +import { AxiosRequestConfig, AxiosResponse } from 'axios'; import { Observable, from, of, switchMap } from 'rxjs'; import { Order } from '../model/order'; import { Configuration } from '../configuration'; @@ -51,8 +51,8 @@ export class StoreService { * @param reportProgress flag to report request and response progress. * @param {*} [options] Override http request option. */ - public deleteOrder(orderId: string, options?: RawAxiosRequestConfig): Observable>; - public deleteOrder(orderId: string, options?: RawAxiosRequestConfig): Observable { + public deleteOrder(orderId: string, options?: AxiosRequestConfig): Observable>; + public deleteOrder(orderId: string, options?: AxiosRequestConfig): Observable { if (orderId === null || orderId === undefined) { throw new Error('Required parameter orderId was null or undefined when calling deleteOrder.'); } @@ -95,8 +95,8 @@ export class StoreService { * @param reportProgress flag to report request and response progress. * @param {*} [options] Override http request option. */ - public getInventory(options?: RawAxiosRequestConfig): Observable>; - public getInventory(options?: RawAxiosRequestConfig): Observable { + public getInventory(options?: AxiosRequestConfig): Observable>; + public getInventory(options?: AxiosRequestConfig): Observable { let headers = {...this.defaultHeaders}; let accessTokenObservable: Observable = of(null); @@ -142,8 +142,8 @@ export class StoreService { * @param reportProgress flag to report request and response progress. * @param {*} [options] Override http request option. */ - public getOrderById(orderId: number, options?: RawAxiosRequestConfig): Observable>; - public getOrderById(orderId: number, options?: RawAxiosRequestConfig): Observable { + public getOrderById(orderId: number, options?: AxiosRequestConfig): Observable>; + public getOrderById(orderId: number, options?: AxiosRequestConfig): Observable { if (orderId === null || orderId === undefined) { throw new Error('Required parameter orderId was null or undefined when calling getOrderById.'); } @@ -189,8 +189,8 @@ export class StoreService { * @param reportProgress flag to report request and response progress. * @param {*} [options] Override http request option. */ - public placeOrder(order: Order, options?: RawAxiosRequestConfig): Observable>; - public placeOrder(order: Order, options?: RawAxiosRequestConfig): Observable { + public placeOrder(order: Order, options?: AxiosRequestConfig): Observable>; + public placeOrder(order: Order, options?: AxiosRequestConfig): Observable { if (order === null || order === undefined) { throw new Error('Required parameter order was null or undefined when calling placeOrder.'); } 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 43cc58348a63..0f5e5d231645 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, RawAxiosRequestConfig } from 'axios'; +import { AxiosRequestConfig, AxiosResponse } from 'axios'; import { Observable, from, of, switchMap } from 'rxjs'; import { User } from '../model/user'; import { Configuration } from '../configuration'; @@ -51,8 +51,8 @@ export class UserService { * @param reportProgress flag to report request and response progress. * @param {*} [options] Override http request option. */ - public createUser(user: User, options?: RawAxiosRequestConfig): Observable>; - public createUser(user: User, options?: RawAxiosRequestConfig): Observable { + public createUser(user: User, options?: AxiosRequestConfig): Observable>; + public createUser(user: User, options?: AxiosRequestConfig): Observable { if (user === null || user === undefined) { throw new Error('Required parameter user was null or undefined when calling createUser.'); } @@ -107,8 +107,8 @@ export class UserService { * @param reportProgress flag to report request and response progress. * @param {*} [options] Override http request option. */ - public createUsersWithArrayInput(user: Array, options?: RawAxiosRequestConfig): Observable>; - public createUsersWithArrayInput(user: Array, options?: RawAxiosRequestConfig): Observable { + public createUsersWithArrayInput(user: Array, options?: AxiosRequestConfig): Observable>; + public createUsersWithArrayInput(user: Array, options?: AxiosRequestConfig): Observable { if (user === null || user === undefined) { throw new Error('Required parameter user was null or undefined when calling createUsersWithArrayInput.'); } @@ -163,8 +163,8 @@ export class UserService { * @param reportProgress flag to report request and response progress. * @param {*} [options] Override http request option. */ - public createUsersWithListInput(user: Array, options?: RawAxiosRequestConfig): Observable>; - public createUsersWithListInput(user: Array, options?: RawAxiosRequestConfig): Observable { + public createUsersWithListInput(user: Array, options?: AxiosRequestConfig): Observable>; + public createUsersWithListInput(user: Array, options?: AxiosRequestConfig): Observable { if (user === null || user === undefined) { throw new Error('Required parameter user was null or undefined when calling createUsersWithListInput.'); } @@ -219,8 +219,8 @@ export class UserService { * @param reportProgress flag to report request and response progress. * @param {*} [options] Override http request option. */ - public deleteUser(username: string, options?: RawAxiosRequestConfig): Observable>; - public deleteUser(username: string, options?: RawAxiosRequestConfig): Observable { + public deleteUser(username: string, options?: AxiosRequestConfig): Observable>; + public deleteUser(username: string, options?: AxiosRequestConfig): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling deleteUser.'); } @@ -269,8 +269,8 @@ export class UserService { * @param reportProgress flag to report request and response progress. * @param {*} [options] Override http request option. */ - public getUserByName(username: string, options?: RawAxiosRequestConfig): Observable>; - public getUserByName(username: string, options?: RawAxiosRequestConfig): Observable { + public getUserByName(username: string, options?: AxiosRequestConfig): Observable>; + public getUserByName(username: string, options?: AxiosRequestConfig): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling getUserByName.'); } @@ -317,8 +317,8 @@ export class UserService { * @param reportProgress flag to report request and response progress. * @param {*} [options] Override http request option. */ - public loginUser(username: string, password: string, options?: RawAxiosRequestConfig): Observable>; - public loginUser(username: string, password: string, options?: RawAxiosRequestConfig): Observable { + public loginUser(username: string, password: string, options?: AxiosRequestConfig): Observable>; + public loginUser(username: string, password: string, options?: AxiosRequestConfig): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling loginUser.'); } @@ -376,8 +376,8 @@ export class UserService { * @param reportProgress flag to report request and response progress. * @param {*} [options] Override http request option. */ - public logoutUser(options?: RawAxiosRequestConfig): Observable>; - public logoutUser(options?: RawAxiosRequestConfig): Observable { + public logoutUser(options?: AxiosRequestConfig): Observable>; + public logoutUser(options?: AxiosRequestConfig): Observable { let headers = {...this.defaultHeaders}; let accessTokenObservable: Observable = of(null); @@ -423,8 +423,8 @@ export class UserService { * @param reportProgress flag to report request and response progress. * @param {*} [options] Override http request option. */ - public updateUser(username: string, user: User, options?: RawAxiosRequestConfig): Observable>; - public updateUser(username: string, user: User, options?: RawAxiosRequestConfig): Observable { + public updateUser(username: string, user: User, options?: AxiosRequestConfig): Observable>; + public updateUser(username: string, user: User, options?: AxiosRequestConfig): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling updateUser.'); } From 1b8452220622c36c361e571e943eed85713c6bf0 Mon Sep 17 00:00:00 2001 From: Gregory Merlet Date: Tue, 28 Jan 2025 16:39:16 +0100 Subject: [PATCH 3/7] refactor: change options parameter --- .../typescript-nestjs/api.service.mustache | 14 ++-- .../builds/default/api/pet.service.ts | 80 +++++++++---------- .../builds/default/api/store.service.ts | 40 +++++----- .../builds/default/api/user.service.ts | 80 +++++++++---------- .../builds/default/api/pet.service.ts | 80 +++++++++---------- .../builds/default/api/store.service.ts | 40 +++++----- .../builds/default/api/user.service.ts | 80 +++++++++---------- 7 files changed, 207 insertions(+), 207 deletions(-) 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 ac6fba81936b..d81a6eb2b5a6 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 @@ -93,15 +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 {*} [options] Override http request option. + * @param {*} [{{nickname}}RequestConfig.options] Override http request option. */ {{#useSingleRequestParameter}} - public {{nickname}}({{#allParams.0}}requestParameters: {{classname}}{{operationIdCamelCase}}Request, {{/allParams.0}}options?: AxiosRequestConfig): Observable>; - public {{nickname}}({{#allParams.0}}requestParameters: {{classname}}{{operationIdCamelCase}}Request, {{/allParams.0}}options?: AxiosRequestConfig): Observable { + public {{nickname}}({{#allParams.0}}requestParameters: {{classname}}{{operationIdCamelCase}}Request, {{/allParams.0}}{{nickname}}RequestConfig?: { options?: AxiosRequestConfig }): Observable>; + public {{nickname}}({{#allParams.0}}requestParameters: {{classname}}{{operationIdCamelCase}}Request, {{/allParams.0}}{{nickname}}RequestConfig?: { options?: AxiosRequestConfig }): Observable { {{/useSingleRequestParameter}} {{^useSingleRequestParameter}} - public {{nickname}}({{#allParams}}{{^isConstEnumParam}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/isConstEnumParam}}{{/allParams}}options?: AxiosRequestConfig): Observable>; - public {{nickname}}({{#allParams}}{{^isConstEnumParam}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/isConstEnumParam}}{{/allParams}}options?: AxiosRequestConfig): Observable { + public {{nickname}}({{#allParams}}{{^isConstEnumParam}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/isConstEnumParam}}{{/allParams}}{{nickname}}RequestConfig?: { options?: AxiosRequestConfig }): Observable>; + public {{nickname}}({{#allParams}}{{^isConstEnumParam}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/isConstEnumParam}}{{/allParams}}{{nickname}}RequestConfig?: { options?: AxiosRequestConfig }): Observable { {{/useSingleRequestParameter}} {{#allParams.0}} {{#useSingleRequestParameter}} @@ -292,8 +292,8 @@ export class {{classname}} { responseType: "blob", {{/isResponseFile}} withCredentials: this.configuration.withCredentials, - headers: {...headers, ...options?.headers}, - ...options, + headers: {...headers, ...{{nickname}}RequestConfig?.options?.headers}, + ...{{nickname}}RequestConfig?.options, } ); }) 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 69191977a2a0..81d8f216bf39 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 @@ -49,10 +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 {*} [options] Override http request option. + * @param {*} [addPetRequestConfig.options] Override http request option. */ - public addPet(pet: Pet, options?: AxiosRequestConfig): Observable>; - public addPet(pet: Pet, options?: AxiosRequestConfig): Observable { + public addPet(pet: Pet, addPetRequestConfig?: { options?: AxiosRequestConfig }): Observable>; + public addPet(pet: Pet, addPetRequestConfig?: { options?: AxiosRequestConfig }): Observable { if (pet === null || pet === undefined) { throw new Error('Required parameter pet was null or undefined when calling addPet.'); } @@ -97,8 +97,8 @@ export class PetService { pet, { withCredentials: this.configuration.withCredentials, - headers: {...headers, ...options?.headers}, - ...options, + headers: {...headers, ...addPetRequestConfig?.options?.headers}, + ...addPetRequestConfig?.options, } ); }) @@ -111,10 +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 {*} [options] Override http request option. + * @param {*} [deletePetRequestConfig.options] Override http request option. */ - public deletePet(petId: number, apiKey?: string, options?: AxiosRequestConfig): Observable>; - public deletePet(petId: number, apiKey?: string, options?: AxiosRequestConfig): Observable { + public deletePet(petId: number, apiKey?: string, deletePetRequestConfig?: { options?: AxiosRequestConfig }): Observable>; + public deletePet(petId: number, apiKey?: string, deletePetRequestConfig?: { options?: AxiosRequestConfig }): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling deletePet.'); } @@ -153,8 +153,8 @@ export class PetService { return this.httpClient.delete(`${this.basePath}/pet/${encodeURIComponent(String(petId))}`, { withCredentials: this.configuration.withCredentials, - headers: {...headers, ...options?.headers}, - ...options, + headers: {...headers, ...deletePetRequestConfig?.options?.headers}, + ...deletePetRequestConfig?.options, } ); }) @@ -166,10 +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 {*} [options] Override http request option. + * @param {*} [findPetsByStatusRequestConfig.options] Override http request option. */ - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: AxiosRequestConfig): Observable>>; - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: AxiosRequestConfig): Observable { + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, findPetsByStatusRequestConfig?: { options?: AxiosRequestConfig }): Observable>>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, findPetsByStatusRequestConfig?: { options?: AxiosRequestConfig }): Observable { if (status === null || status === undefined) { throw new Error('Required parameter status was null or undefined when calling findPetsByStatus.'); } @@ -213,8 +213,8 @@ export class PetService { { params: queryParameters, withCredentials: this.configuration.withCredentials, - headers: {...headers, ...options?.headers}, - ...options, + headers: {...headers, ...findPetsByStatusRequestConfig?.options?.headers}, + ...findPetsByStatusRequestConfig?.options, } ); }) @@ -226,10 +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 {*} [options] Override http request option. + * @param {*} [findPetsByTagsRequestConfig.options] Override http request option. */ - public findPetsByTags(tags: Array, options?: AxiosRequestConfig): Observable>>; - public findPetsByTags(tags: Array, options?: AxiosRequestConfig): Observable { + public findPetsByTags(tags: Array, findPetsByTagsRequestConfig?: { options?: AxiosRequestConfig }): Observable>>; + public findPetsByTags(tags: Array, findPetsByTagsRequestConfig?: { options?: AxiosRequestConfig }): Observable { if (tags === null || tags === undefined) { throw new Error('Required parameter tags was null or undefined when calling findPetsByTags.'); } @@ -273,8 +273,8 @@ export class PetService { { params: queryParameters, withCredentials: this.configuration.withCredentials, - headers: {...headers, ...options?.headers}, - ...options, + headers: {...headers, ...findPetsByTagsRequestConfig?.options?.headers}, + ...findPetsByTagsRequestConfig?.options, } ); }) @@ -286,10 +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 {*} [options] Override http request option. + * @param {*} [getPetByIdRequestConfig.options] Override http request option. */ - public getPetById(petId: number, options?: AxiosRequestConfig): Observable>; - public getPetById(petId: number, options?: AxiosRequestConfig): Observable { + public getPetById(petId: number, getPetByIdRequestConfig?: { options?: AxiosRequestConfig }): Observable>; + public getPetById(petId: number, getPetByIdRequestConfig?: { options?: AxiosRequestConfig }): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling getPetById.'); } @@ -325,8 +325,8 @@ export class PetService { return this.httpClient.get(`${this.basePath}/pet/${encodeURIComponent(String(petId))}`, { withCredentials: this.configuration.withCredentials, - headers: {...headers, ...options?.headers}, - ...options, + headers: {...headers, ...getPetByIdRequestConfig?.options?.headers}, + ...getPetByIdRequestConfig?.options, } ); }) @@ -338,10 +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 {*} [options] Override http request option. + * @param {*} [updatePetRequestConfig.options] Override http request option. */ - public updatePet(pet: Pet, options?: AxiosRequestConfig): Observable>; - public updatePet(pet: Pet, options?: AxiosRequestConfig): Observable { + public updatePet(pet: Pet, updatePetRequestConfig?: { options?: AxiosRequestConfig }): Observable>; + public updatePet(pet: Pet, updatePetRequestConfig?: { options?: AxiosRequestConfig }): Observable { if (pet === null || pet === undefined) { throw new Error('Required parameter pet was null or undefined when calling updatePet.'); } @@ -386,8 +386,8 @@ export class PetService { pet, { withCredentials: this.configuration.withCredentials, - headers: {...headers, ...options?.headers}, - ...options, + headers: {...headers, ...updatePetRequestConfig?.options?.headers}, + ...updatePetRequestConfig?.options, } ); }) @@ -401,10 +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 {*} [options] Override http request option. + * @param {*} [updatePetWithFormRequestConfig.options] Override http request option. */ - public updatePetWithForm(petId: number, name?: string, status?: string, options?: AxiosRequestConfig): Observable>; - public updatePetWithForm(petId: number, name?: string, status?: string, options?: AxiosRequestConfig): Observable { + public updatePetWithForm(petId: number, name?: string, status?: string, updatePetWithFormRequestConfig?: { options?: AxiosRequestConfig }): Observable>; + public updatePetWithForm(petId: number, name?: string, status?: string, updatePetWithFormRequestConfig?: { options?: AxiosRequestConfig }): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling updatePetWithForm.'); } @@ -462,8 +462,8 @@ export class PetService { convertFormParamsToString ? formParams!.toString() : formParams!, { withCredentials: this.configuration.withCredentials, - headers: {...headers, ...options?.headers}, - ...options, + headers: {...headers, ...updatePetWithFormRequestConfig?.options?.headers}, + ...updatePetWithFormRequestConfig?.options, } ); }) @@ -477,10 +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 {*} [options] Override http request option. + * @param {*} [uploadFileRequestConfig.options] Override http request option. */ - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, options?: AxiosRequestConfig): Observable>; - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, options?: AxiosRequestConfig): Observable { + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, uploadFileRequestConfig?: { options?: AxiosRequestConfig }): Observable>; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, uploadFileRequestConfig?: { options?: AxiosRequestConfig }): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling uploadFile.'); } @@ -543,8 +543,8 @@ export class PetService { convertFormParamsToString ? formParams!.toString() : formParams!, { withCredentials: this.configuration.withCredentials, - headers: {...headers, ...options?.headers}, - ...options, + headers: {...headers, ...uploadFileRequestConfig?.options?.headers}, + ...uploadFileRequestConfig?.options, } ); }) 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 5660510c6e2f..f573851adc65 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 @@ -48,10 +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 {*} [options] Override http request option. + * @param {*} [deleteOrderRequestConfig.options] Override http request option. */ - public deleteOrder(orderId: string, options?: AxiosRequestConfig): Observable>; - public deleteOrder(orderId: string, options?: AxiosRequestConfig): Observable { + public deleteOrder(orderId: string, deleteOrderRequestConfig?: { options?: AxiosRequestConfig }): Observable>; + public deleteOrder(orderId: string, deleteOrderRequestConfig?: { options?: AxiosRequestConfig }): Observable { if (orderId === null || orderId === undefined) { throw new Error('Required parameter orderId was null or undefined when calling deleteOrder.'); } @@ -80,8 +80,8 @@ export class StoreService { return this.httpClient.delete(`${this.basePath}/store/order/${encodeURIComponent(String(orderId))}`, { withCredentials: this.configuration.withCredentials, - headers: {...headers, ...options?.headers}, - ...options, + headers: {...headers, ...deleteOrderRequestConfig?.options?.headers}, + ...deleteOrderRequestConfig?.options, } ); }) @@ -92,10 +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 {*} [options] Override http request option. + * @param {*} [getInventoryRequestConfig.options] Override http request option. */ - public getInventory(options?: AxiosRequestConfig): Observable>; - public getInventory(options?: AxiosRequestConfig): Observable { + public getInventory(getInventoryRequestConfig?: { options?: AxiosRequestConfig }): Observable>; + public getInventory(getInventoryRequestConfig?: { options?: AxiosRequestConfig }): Observable { let headers = {...this.defaultHeaders}; let accessTokenObservable: Observable = of(null); @@ -126,8 +126,8 @@ export class StoreService { return this.httpClient.get<{ [key: string]: number; }>(`${this.basePath}/store/inventory`, { withCredentials: this.configuration.withCredentials, - headers: {...headers, ...options?.headers}, - ...options, + headers: {...headers, ...getInventoryRequestConfig?.options?.headers}, + ...getInventoryRequestConfig?.options, } ); }) @@ -139,10 +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 {*} [options] Override http request option. + * @param {*} [getOrderByIdRequestConfig.options] Override http request option. */ - public getOrderById(orderId: number, options?: AxiosRequestConfig): Observable>; - public getOrderById(orderId: number, options?: AxiosRequestConfig): Observable { + public getOrderById(orderId: number, getOrderByIdRequestConfig?: { options?: AxiosRequestConfig }): Observable>; + public getOrderById(orderId: number, getOrderByIdRequestConfig?: { options?: AxiosRequestConfig }): Observable { if (orderId === null || orderId === undefined) { throw new Error('Required parameter orderId was null or undefined when calling getOrderById.'); } @@ -173,8 +173,8 @@ export class StoreService { return this.httpClient.get(`${this.basePath}/store/order/${encodeURIComponent(String(orderId))}`, { withCredentials: this.configuration.withCredentials, - headers: {...headers, ...options?.headers}, - ...options, + headers: {...headers, ...getOrderByIdRequestConfig?.options?.headers}, + ...getOrderByIdRequestConfig?.options, } ); }) @@ -186,10 +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 {*} [options] Override http request option. + * @param {*} [placeOrderRequestConfig.options] Override http request option. */ - public placeOrder(order: Order, options?: AxiosRequestConfig): Observable>; - public placeOrder(order: Order, options?: AxiosRequestConfig): Observable { + public placeOrder(order: Order, placeOrderRequestConfig?: { options?: AxiosRequestConfig }): Observable>; + public placeOrder(order: Order, placeOrderRequestConfig?: { options?: AxiosRequestConfig }): Observable { if (order === null || order === undefined) { throw new Error('Required parameter order was null or undefined when calling placeOrder.'); } @@ -226,8 +226,8 @@ export class StoreService { order, { withCredentials: this.configuration.withCredentials, - headers: {...headers, ...options?.headers}, - ...options, + headers: {...headers, ...placeOrderRequestConfig?.options?.headers}, + ...placeOrderRequestConfig?.options, } ); }) 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 81925ba55571..d531e5392ef7 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 @@ -48,10 +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 {*} [options] Override http request option. + * @param {*} [createUserRequestConfig.options] Override http request option. */ - public createUser(user: User, options?: AxiosRequestConfig): Observable>; - public createUser(user: User, options?: AxiosRequestConfig): Observable { + public createUser(user: User, createUserRequestConfig?: { options?: AxiosRequestConfig }): Observable>; + public createUser(user: User, createUserRequestConfig?: { options?: AxiosRequestConfig }): Observable { if (user === null || user === undefined) { throw new Error('Required parameter user was null or undefined when calling createUser.'); } @@ -91,8 +91,8 @@ export class UserService { user, { withCredentials: this.configuration.withCredentials, - headers: {...headers, ...options?.headers}, - ...options, + headers: {...headers, ...createUserRequestConfig?.options?.headers}, + ...createUserRequestConfig?.options, } ); }) @@ -104,10 +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 {*} [options] Override http request option. + * @param {*} [createUsersWithArrayInputRequestConfig.options] Override http request option. */ - public createUsersWithArrayInput(user: Array, options?: AxiosRequestConfig): Observable>; - public createUsersWithArrayInput(user: Array, options?: AxiosRequestConfig): Observable { + public createUsersWithArrayInput(user: Array, createUsersWithArrayInputRequestConfig?: { options?: AxiosRequestConfig }): Observable>; + public createUsersWithArrayInput(user: Array, createUsersWithArrayInputRequestConfig?: { options?: AxiosRequestConfig }): Observable { if (user === null || user === undefined) { throw new Error('Required parameter user was null or undefined when calling createUsersWithArrayInput.'); } @@ -147,8 +147,8 @@ export class UserService { user, { withCredentials: this.configuration.withCredentials, - headers: {...headers, ...options?.headers}, - ...options, + headers: {...headers, ...createUsersWithArrayInputRequestConfig?.options?.headers}, + ...createUsersWithArrayInputRequestConfig?.options, } ); }) @@ -160,10 +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 {*} [options] Override http request option. + * @param {*} [createUsersWithListInputRequestConfig.options] Override http request option. */ - public createUsersWithListInput(user: Array, options?: AxiosRequestConfig): Observable>; - public createUsersWithListInput(user: Array, options?: AxiosRequestConfig): Observable { + public createUsersWithListInput(user: Array, createUsersWithListInputRequestConfig?: { options?: AxiosRequestConfig }): Observable>; + public createUsersWithListInput(user: Array, createUsersWithListInputRequestConfig?: { options?: AxiosRequestConfig }): Observable { if (user === null || user === undefined) { throw new Error('Required parameter user was null or undefined when calling createUsersWithListInput.'); } @@ -203,8 +203,8 @@ export class UserService { user, { withCredentials: this.configuration.withCredentials, - headers: {...headers, ...options?.headers}, - ...options, + headers: {...headers, ...createUsersWithListInputRequestConfig?.options?.headers}, + ...createUsersWithListInputRequestConfig?.options, } ); }) @@ -216,10 +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 {*} [options] Override http request option. + * @param {*} [deleteUserRequestConfig.options] Override http request option. */ - public deleteUser(username: string, options?: AxiosRequestConfig): Observable>; - public deleteUser(username: string, options?: AxiosRequestConfig): Observable { + public deleteUser(username: string, deleteUserRequestConfig?: { options?: AxiosRequestConfig }): Observable>; + public deleteUser(username: string, deleteUserRequestConfig?: { options?: AxiosRequestConfig }): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling deleteUser.'); } @@ -253,8 +253,8 @@ export class UserService { return this.httpClient.delete(`${this.basePath}/user/${encodeURIComponent(String(username))}`, { withCredentials: this.configuration.withCredentials, - headers: {...headers, ...options?.headers}, - ...options, + headers: {...headers, ...deleteUserRequestConfig?.options?.headers}, + ...deleteUserRequestConfig?.options, } ); }) @@ -266,10 +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 {*} [options] Override http request option. + * @param {*} [getUserByNameRequestConfig.options] Override http request option. */ - public getUserByName(username: string, options?: AxiosRequestConfig): Observable>; - public getUserByName(username: string, options?: AxiosRequestConfig): Observable { + public getUserByName(username: string, getUserByNameRequestConfig?: { options?: AxiosRequestConfig }): Observable>; + public getUserByName(username: string, getUserByNameRequestConfig?: { options?: AxiosRequestConfig }): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling getUserByName.'); } @@ -300,8 +300,8 @@ export class UserService { return this.httpClient.get(`${this.basePath}/user/${encodeURIComponent(String(username))}`, { withCredentials: this.configuration.withCredentials, - headers: {...headers, ...options?.headers}, - ...options, + headers: {...headers, ...getUserByNameRequestConfig?.options?.headers}, + ...getUserByNameRequestConfig?.options, } ); }) @@ -314,10 +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 {*} [options] Override http request option. + * @param {*} [loginUserRequestConfig.options] Override http request option. */ - public loginUser(username: string, password: string, options?: AxiosRequestConfig): Observable>; - public loginUser(username: string, password: string, options?: AxiosRequestConfig): Observable { + public loginUser(username: string, password: string, loginUserRequestConfig?: { options?: AxiosRequestConfig }): Observable>; + public loginUser(username: string, password: string, loginUserRequestConfig?: { options?: AxiosRequestConfig }): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling loginUser.'); } @@ -361,8 +361,8 @@ export class UserService { { params: queryParameters, withCredentials: this.configuration.withCredentials, - headers: {...headers, ...options?.headers}, - ...options, + headers: {...headers, ...loginUserRequestConfig?.options?.headers}, + ...loginUserRequestConfig?.options, } ); }) @@ -373,10 +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 {*} [options] Override http request option. + * @param {*} [logoutUserRequestConfig.options] Override http request option. */ - public logoutUser(options?: AxiosRequestConfig): Observable>; - public logoutUser(options?: AxiosRequestConfig): Observable { + public logoutUser(logoutUserRequestConfig?: { options?: AxiosRequestConfig }): Observable>; + public logoutUser(logoutUserRequestConfig?: { options?: AxiosRequestConfig }): Observable { let headers = {...this.defaultHeaders}; let accessTokenObservable: Observable = of(null); @@ -406,8 +406,8 @@ export class UserService { return this.httpClient.get(`${this.basePath}/user/logout`, { withCredentials: this.configuration.withCredentials, - headers: {...headers, ...options?.headers}, - ...options, + headers: {...headers, ...logoutUserRequestConfig?.options?.headers}, + ...logoutUserRequestConfig?.options, } ); }) @@ -420,10 +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 {*} [options] Override http request option. + * @param {*} [updateUserRequestConfig.options] Override http request option. */ - public updateUser(username: string, user: User, options?: AxiosRequestConfig): Observable>; - public updateUser(username: string, user: User, options?: AxiosRequestConfig): Observable { + public updateUser(username: string, user: User, updateUserRequestConfig?: { options?: AxiosRequestConfig }): Observable>; + public updateUser(username: string, user: User, updateUserRequestConfig?: { options?: AxiosRequestConfig }): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling updateUser.'); } @@ -467,8 +467,8 @@ export class UserService { user, { withCredentials: this.configuration.withCredentials, - headers: {...headers, ...options?.headers}, - ...options, + headers: {...headers, ...updateUserRequestConfig?.options?.headers}, + ...updateUserRequestConfig?.options, } ); }) 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 66881b7c6f5f..16d4d5d4a6b6 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 @@ -50,10 +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 {*} [options] Override http request option. + * @param {*} [addPetRequestConfig.options] Override http request option. */ - public addPet(pet: Pet, options?: AxiosRequestConfig): Observable>; - public addPet(pet: Pet, options?: AxiosRequestConfig): Observable { + public addPet(pet: Pet, addPetRequestConfig?: { options?: AxiosRequestConfig }): Observable>; + public addPet(pet: Pet, addPetRequestConfig?: { options?: AxiosRequestConfig }): Observable { if (pet === null || pet === undefined) { throw new Error('Required parameter pet was null or undefined when calling addPet.'); } @@ -98,8 +98,8 @@ export class PetService { pet, { withCredentials: this.configuration.withCredentials, - headers: {...headers, ...options?.headers}, - ...options, + headers: {...headers, ...addPetRequestConfig?.options?.headers}, + ...addPetRequestConfig?.options, } ); }) @@ -112,10 +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 {*} [options] Override http request option. + * @param {*} [deletePetRequestConfig.options] Override http request option. */ - public deletePet(petId: number, apiKey?: string, options?: AxiosRequestConfig): Observable>; - public deletePet(petId: number, apiKey?: string, options?: AxiosRequestConfig): Observable { + public deletePet(petId: number, apiKey?: string, deletePetRequestConfig?: { options?: AxiosRequestConfig }): Observable>; + public deletePet(petId: number, apiKey?: string, deletePetRequestConfig?: { options?: AxiosRequestConfig }): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling deletePet.'); } @@ -154,8 +154,8 @@ export class PetService { return this.httpClient.delete(`${this.basePath}/pet/${encodeURIComponent(String(petId))}`, { withCredentials: this.configuration.withCredentials, - headers: {...headers, ...options?.headers}, - ...options, + headers: {...headers, ...deletePetRequestConfig?.options?.headers}, + ...deletePetRequestConfig?.options, } ); }) @@ -167,10 +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 {*} [options] Override http request option. + * @param {*} [findPetsByStatusRequestConfig.options] Override http request option. */ - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: AxiosRequestConfig): Observable>>; - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: AxiosRequestConfig): Observable { + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, findPetsByStatusRequestConfig?: { options?: AxiosRequestConfig }): Observable>>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, findPetsByStatusRequestConfig?: { options?: AxiosRequestConfig }): Observable { if (status === null || status === undefined) { throw new Error('Required parameter status was null or undefined when calling findPetsByStatus.'); } @@ -214,8 +214,8 @@ export class PetService { { params: queryParameters, withCredentials: this.configuration.withCredentials, - headers: {...headers, ...options?.headers}, - ...options, + headers: {...headers, ...findPetsByStatusRequestConfig?.options?.headers}, + ...findPetsByStatusRequestConfig?.options, } ); }) @@ -227,10 +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 {*} [options] Override http request option. + * @param {*} [findPetsByTagsRequestConfig.options] Override http request option. */ - public findPetsByTags(tags: Array, options?: AxiosRequestConfig): Observable>>; - public findPetsByTags(tags: Array, options?: AxiosRequestConfig): Observable { + public findPetsByTags(tags: Array, findPetsByTagsRequestConfig?: { options?: AxiosRequestConfig }): Observable>>; + public findPetsByTags(tags: Array, findPetsByTagsRequestConfig?: { options?: AxiosRequestConfig }): Observable { if (tags === null || tags === undefined) { throw new Error('Required parameter tags was null or undefined when calling findPetsByTags.'); } @@ -274,8 +274,8 @@ export class PetService { { params: queryParameters, withCredentials: this.configuration.withCredentials, - headers: {...headers, ...options?.headers}, - ...options, + headers: {...headers, ...findPetsByTagsRequestConfig?.options?.headers}, + ...findPetsByTagsRequestConfig?.options, } ); }) @@ -287,10 +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 {*} [options] Override http request option. + * @param {*} [getPetByIdRequestConfig.options] Override http request option. */ - public getPetById(petId: number, options?: AxiosRequestConfig): Observable>; - public getPetById(petId: number, options?: AxiosRequestConfig): Observable { + public getPetById(petId: number, getPetByIdRequestConfig?: { options?: AxiosRequestConfig }): Observable>; + public getPetById(petId: number, getPetByIdRequestConfig?: { options?: AxiosRequestConfig }): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling getPetById.'); } @@ -326,8 +326,8 @@ export class PetService { return this.httpClient.get(`${this.basePath}/pet/${encodeURIComponent(String(petId))}`, { withCredentials: this.configuration.withCredentials, - headers: {...headers, ...options?.headers}, - ...options, + headers: {...headers, ...getPetByIdRequestConfig?.options?.headers}, + ...getPetByIdRequestConfig?.options, } ); }) @@ -339,10 +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 {*} [options] Override http request option. + * @param {*} [updatePetRequestConfig.options] Override http request option. */ - public updatePet(pet: Pet, options?: AxiosRequestConfig): Observable>; - public updatePet(pet: Pet, options?: AxiosRequestConfig): Observable { + public updatePet(pet: Pet, updatePetRequestConfig?: { options?: AxiosRequestConfig }): Observable>; + public updatePet(pet: Pet, updatePetRequestConfig?: { options?: AxiosRequestConfig }): Observable { if (pet === null || pet === undefined) { throw new Error('Required parameter pet was null or undefined when calling updatePet.'); } @@ -387,8 +387,8 @@ export class PetService { pet, { withCredentials: this.configuration.withCredentials, - headers: {...headers, ...options?.headers}, - ...options, + headers: {...headers, ...updatePetRequestConfig?.options?.headers}, + ...updatePetRequestConfig?.options, } ); }) @@ -402,10 +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 {*} [options] Override http request option. + * @param {*} [updatePetWithFormRequestConfig.options] Override http request option. */ - public updatePetWithForm(petId: number, name?: string, status?: string, options?: AxiosRequestConfig): Observable>; - public updatePetWithForm(petId: number, name?: string, status?: string, options?: AxiosRequestConfig): Observable { + public updatePetWithForm(petId: number, name?: string, status?: string, updatePetWithFormRequestConfig?: { options?: AxiosRequestConfig }): Observable>; + public updatePetWithForm(petId: number, name?: string, status?: string, updatePetWithFormRequestConfig?: { options?: AxiosRequestConfig }): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling updatePetWithForm.'); } @@ -463,8 +463,8 @@ export class PetService { convertFormParamsToString ? formParams!.toString() : formParams!, { withCredentials: this.configuration.withCredentials, - headers: {...headers, ...options?.headers}, - ...options, + headers: {...headers, ...updatePetWithFormRequestConfig?.options?.headers}, + ...updatePetWithFormRequestConfig?.options, } ); }) @@ -478,10 +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 {*} [options] Override http request option. + * @param {*} [uploadFileRequestConfig.options] Override http request option. */ - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, options?: AxiosRequestConfig): Observable>; - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, options?: AxiosRequestConfig): Observable { + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, uploadFileRequestConfig?: { options?: AxiosRequestConfig }): Observable>; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, uploadFileRequestConfig?: { options?: AxiosRequestConfig }): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling uploadFile.'); } @@ -544,8 +544,8 @@ export class PetService { convertFormParamsToString ? formParams!.toString() : formParams!, { withCredentials: this.configuration.withCredentials, - headers: {...headers, ...options?.headers}, - ...options, + headers: {...headers, ...uploadFileRequestConfig?.options?.headers}, + ...uploadFileRequestConfig?.options, } ); }) 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 b0fad97c5fc3..37d6eb360d9d 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 @@ -49,10 +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 {*} [options] Override http request option. + * @param {*} [deleteOrderRequestConfig.options] Override http request option. */ - public deleteOrder(orderId: string, options?: AxiosRequestConfig): Observable>; - public deleteOrder(orderId: string, options?: AxiosRequestConfig): Observable { + public deleteOrder(orderId: string, deleteOrderRequestConfig?: { options?: AxiosRequestConfig }): Observable>; + public deleteOrder(orderId: string, deleteOrderRequestConfig?: { options?: AxiosRequestConfig }): Observable { if (orderId === null || orderId === undefined) { throw new Error('Required parameter orderId was null or undefined when calling deleteOrder.'); } @@ -81,8 +81,8 @@ export class StoreService { return this.httpClient.delete(`${this.basePath}/store/order/${encodeURIComponent(String(orderId))}`, { withCredentials: this.configuration.withCredentials, - headers: {...headers, ...options?.headers}, - ...options, + headers: {...headers, ...deleteOrderRequestConfig?.options?.headers}, + ...deleteOrderRequestConfig?.options, } ); }) @@ -93,10 +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 {*} [options] Override http request option. + * @param {*} [getInventoryRequestConfig.options] Override http request option. */ - public getInventory(options?: AxiosRequestConfig): Observable>; - public getInventory(options?: AxiosRequestConfig): Observable { + public getInventory(getInventoryRequestConfig?: { options?: AxiosRequestConfig }): Observable>; + public getInventory(getInventoryRequestConfig?: { options?: AxiosRequestConfig }): Observable { let headers = {...this.defaultHeaders}; let accessTokenObservable: Observable = of(null); @@ -127,8 +127,8 @@ export class StoreService { return this.httpClient.get<{ [key: string]: number; }>(`${this.basePath}/store/inventory`, { withCredentials: this.configuration.withCredentials, - headers: {...headers, ...options?.headers}, - ...options, + headers: {...headers, ...getInventoryRequestConfig?.options?.headers}, + ...getInventoryRequestConfig?.options, } ); }) @@ -140,10 +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 {*} [options] Override http request option. + * @param {*} [getOrderByIdRequestConfig.options] Override http request option. */ - public getOrderById(orderId: number, options?: AxiosRequestConfig): Observable>; - public getOrderById(orderId: number, options?: AxiosRequestConfig): Observable { + public getOrderById(orderId: number, getOrderByIdRequestConfig?: { options?: AxiosRequestConfig }): Observable>; + public getOrderById(orderId: number, getOrderByIdRequestConfig?: { options?: AxiosRequestConfig }): Observable { if (orderId === null || orderId === undefined) { throw new Error('Required parameter orderId was null or undefined when calling getOrderById.'); } @@ -174,8 +174,8 @@ export class StoreService { return this.httpClient.get(`${this.basePath}/store/order/${encodeURIComponent(String(orderId))}`, { withCredentials: this.configuration.withCredentials, - headers: {...headers, ...options?.headers}, - ...options, + headers: {...headers, ...getOrderByIdRequestConfig?.options?.headers}, + ...getOrderByIdRequestConfig?.options, } ); }) @@ -187,10 +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 {*} [options] Override http request option. + * @param {*} [placeOrderRequestConfig.options] Override http request option. */ - public placeOrder(order: Order, options?: AxiosRequestConfig): Observable>; - public placeOrder(order: Order, options?: AxiosRequestConfig): Observable { + public placeOrder(order: Order, placeOrderRequestConfig?: { options?: AxiosRequestConfig }): Observable>; + public placeOrder(order: Order, placeOrderRequestConfig?: { options?: AxiosRequestConfig }): Observable { if (order === null || order === undefined) { throw new Error('Required parameter order was null or undefined when calling placeOrder.'); } @@ -227,8 +227,8 @@ export class StoreService { order, { withCredentials: this.configuration.withCredentials, - headers: {...headers, ...options?.headers}, - ...options, + headers: {...headers, ...placeOrderRequestConfig?.options?.headers}, + ...placeOrderRequestConfig?.options, } ); }) 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 0f5e5d231645..9cf76aeda8ca 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 @@ -49,10 +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 {*} [options] Override http request option. + * @param {*} [createUserRequestConfig.options] Override http request option. */ - public createUser(user: User, options?: AxiosRequestConfig): Observable>; - public createUser(user: User, options?: AxiosRequestConfig): Observable { + public createUser(user: User, createUserRequestConfig?: { options?: AxiosRequestConfig }): Observable>; + public createUser(user: User, createUserRequestConfig?: { options?: AxiosRequestConfig }): Observable { if (user === null || user === undefined) { throw new Error('Required parameter user was null or undefined when calling createUser.'); } @@ -92,8 +92,8 @@ export class UserService { user, { withCredentials: this.configuration.withCredentials, - headers: {...headers, ...options?.headers}, - ...options, + headers: {...headers, ...createUserRequestConfig?.options?.headers}, + ...createUserRequestConfig?.options, } ); }) @@ -105,10 +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 {*} [options] Override http request option. + * @param {*} [createUsersWithArrayInputRequestConfig.options] Override http request option. */ - public createUsersWithArrayInput(user: Array, options?: AxiosRequestConfig): Observable>; - public createUsersWithArrayInput(user: Array, options?: AxiosRequestConfig): Observable { + public createUsersWithArrayInput(user: Array, createUsersWithArrayInputRequestConfig?: { options?: AxiosRequestConfig }): Observable>; + public createUsersWithArrayInput(user: Array, createUsersWithArrayInputRequestConfig?: { options?: AxiosRequestConfig }): Observable { if (user === null || user === undefined) { throw new Error('Required parameter user was null or undefined when calling createUsersWithArrayInput.'); } @@ -148,8 +148,8 @@ export class UserService { user, { withCredentials: this.configuration.withCredentials, - headers: {...headers, ...options?.headers}, - ...options, + headers: {...headers, ...createUsersWithArrayInputRequestConfig?.options?.headers}, + ...createUsersWithArrayInputRequestConfig?.options, } ); }) @@ -161,10 +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 {*} [options] Override http request option. + * @param {*} [createUsersWithListInputRequestConfig.options] Override http request option. */ - public createUsersWithListInput(user: Array, options?: AxiosRequestConfig): Observable>; - public createUsersWithListInput(user: Array, options?: AxiosRequestConfig): Observable { + public createUsersWithListInput(user: Array, createUsersWithListInputRequestConfig?: { options?: AxiosRequestConfig }): Observable>; + public createUsersWithListInput(user: Array, createUsersWithListInputRequestConfig?: { options?: AxiosRequestConfig }): Observable { if (user === null || user === undefined) { throw new Error('Required parameter user was null or undefined when calling createUsersWithListInput.'); } @@ -204,8 +204,8 @@ export class UserService { user, { withCredentials: this.configuration.withCredentials, - headers: {...headers, ...options?.headers}, - ...options, + headers: {...headers, ...createUsersWithListInputRequestConfig?.options?.headers}, + ...createUsersWithListInputRequestConfig?.options, } ); }) @@ -217,10 +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 {*} [options] Override http request option. + * @param {*} [deleteUserRequestConfig.options] Override http request option. */ - public deleteUser(username: string, options?: AxiosRequestConfig): Observable>; - public deleteUser(username: string, options?: AxiosRequestConfig): Observable { + public deleteUser(username: string, deleteUserRequestConfig?: { options?: AxiosRequestConfig }): Observable>; + public deleteUser(username: string, deleteUserRequestConfig?: { options?: AxiosRequestConfig }): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling deleteUser.'); } @@ -254,8 +254,8 @@ export class UserService { return this.httpClient.delete(`${this.basePath}/user/${encodeURIComponent(String(username))}`, { withCredentials: this.configuration.withCredentials, - headers: {...headers, ...options?.headers}, - ...options, + headers: {...headers, ...deleteUserRequestConfig?.options?.headers}, + ...deleteUserRequestConfig?.options, } ); }) @@ -267,10 +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 {*} [options] Override http request option. + * @param {*} [getUserByNameRequestConfig.options] Override http request option. */ - public getUserByName(username: string, options?: AxiosRequestConfig): Observable>; - public getUserByName(username: string, options?: AxiosRequestConfig): Observable { + public getUserByName(username: string, getUserByNameRequestConfig?: { options?: AxiosRequestConfig }): Observable>; + public getUserByName(username: string, getUserByNameRequestConfig?: { options?: AxiosRequestConfig }): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling getUserByName.'); } @@ -301,8 +301,8 @@ export class UserService { return this.httpClient.get(`${this.basePath}/user/${encodeURIComponent(String(username))}`, { withCredentials: this.configuration.withCredentials, - headers: {...headers, ...options?.headers}, - ...options, + headers: {...headers, ...getUserByNameRequestConfig?.options?.headers}, + ...getUserByNameRequestConfig?.options, } ); }) @@ -315,10 +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 {*} [options] Override http request option. + * @param {*} [loginUserRequestConfig.options] Override http request option. */ - public loginUser(username: string, password: string, options?: AxiosRequestConfig): Observable>; - public loginUser(username: string, password: string, options?: AxiosRequestConfig): Observable { + public loginUser(username: string, password: string, loginUserRequestConfig?: { options?: AxiosRequestConfig }): Observable>; + public loginUser(username: string, password: string, loginUserRequestConfig?: { options?: AxiosRequestConfig }): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling loginUser.'); } @@ -362,8 +362,8 @@ export class UserService { { params: queryParameters, withCredentials: this.configuration.withCredentials, - headers: {...headers, ...options?.headers}, - ...options, + headers: {...headers, ...loginUserRequestConfig?.options?.headers}, + ...loginUserRequestConfig?.options, } ); }) @@ -374,10 +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 {*} [options] Override http request option. + * @param {*} [logoutUserRequestConfig.options] Override http request option. */ - public logoutUser(options?: AxiosRequestConfig): Observable>; - public logoutUser(options?: AxiosRequestConfig): Observable { + public logoutUser(logoutUserRequestConfig?: { options?: AxiosRequestConfig }): Observable>; + public logoutUser(logoutUserRequestConfig?: { options?: AxiosRequestConfig }): Observable { let headers = {...this.defaultHeaders}; let accessTokenObservable: Observable = of(null); @@ -407,8 +407,8 @@ export class UserService { return this.httpClient.get(`${this.basePath}/user/logout`, { withCredentials: this.configuration.withCredentials, - headers: {...headers, ...options?.headers}, - ...options, + headers: {...headers, ...logoutUserRequestConfig?.options?.headers}, + ...logoutUserRequestConfig?.options, } ); }) @@ -421,10 +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 {*} [options] Override http request option. + * @param {*} [updateUserRequestConfig.options] Override http request option. */ - public updateUser(username: string, user: User, options?: AxiosRequestConfig): Observable>; - public updateUser(username: string, user: User, options?: AxiosRequestConfig): Observable { + public updateUser(username: string, user: User, updateUserRequestConfig?: { options?: AxiosRequestConfig }): Observable>; + public updateUser(username: string, user: User, updateUserRequestConfig?: { options?: AxiosRequestConfig }): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling updateUser.'); } @@ -468,8 +468,8 @@ export class UserService { user, { withCredentials: this.configuration.withCredentials, - headers: {...headers, ...options?.headers}, - ...options, + headers: {...headers, ...updateUserRequestConfig?.options?.headers}, + ...updateUserRequestConfig?.options, } ); }) From be1754b2c8d685cc705bf07b2888bb9b48bce92a Mon Sep 17 00:00:00 2001 From: Gregory Merlet Date: Tue, 28 Jan 2025 17:05:05 +0100 Subject: [PATCH 4/7] chore: update samples --- .../builds/reservedParamNames/api/default.service.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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 c41aa37ec06b..ca7d4ee31833 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 { 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 {*} [testReservedParamNamesRequestConfig.options] Override http request option. */ - public testReservedParamNames(requestParameters: DefaultServiceTestReservedParamNamesRequest, ): Observable>; - public testReservedParamNames(requestParameters: DefaultServiceTestReservedParamNamesRequest, ): Observable { + public testReservedParamNames(requestParameters: DefaultServiceTestReservedParamNamesRequest, testReservedParamNamesRequestConfig?: { options?: AxiosRequestConfig }): Observable>; + public testReservedParamNames(requestParameters: DefaultServiceTestReservedParamNamesRequest, testReservedParamNamesRequestConfig?: { options?: AxiosRequestConfig }): Observable { const { notReserved, 'from': _from, @@ -138,7 +139,8 @@ export class DefaultService { { params: queryParameters, withCredentials: this.configuration.withCredentials, - headers: headers + headers: {...headers, ...testReservedParamNamesRequestConfig?.options?.headers}, + ...testReservedParamNamesRequestConfig?.options, } ); }) From fb3c75bfdbf066967b681c24a0ffb8d2ba5b23d5 Mon Sep 17 00:00:00 2001 From: Gregory Merlet Date: Tue, 28 Jan 2025 17:26:46 +0100 Subject: [PATCH 5/7] fix: fix options use order --- .../typescript-nestjs/api.service.mustache | 2 +- .../builds/default/api/pet.service.ts | 16 ++++++++-------- .../builds/default/api/store.service.ts | 8 ++++---- .../builds/default/api/user.service.ts | 16 ++++++++-------- .../builds/default/api/pet.service.ts | 16 ++++++++-------- .../builds/default/api/store.service.ts | 8 ++++---- .../builds/default/api/user.service.ts | 16 ++++++++-------- .../reservedParamNames/api/default.service.ts | 2 +- 8 files changed, 42 insertions(+), 42 deletions(-) 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 d81a6eb2b5a6..8478270540e0 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 @@ -285,6 +285,7 @@ export class {{classname}} { return this.httpClient.{{httpMethod}}{{^isResponseFile}}<{{#returnType}}{{{returnType}}}{{#isResponseTypeFile}}|undefined{{/isResponseTypeFile}}{{/returnType}}{{^returnType}}any{{/returnType}}>{{/isResponseFile}}(`${this.basePath}{{{path}}}`,{{#isBodyAllowed}} {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}{{#hasFormParams}}convertFormParamsToString ? formParams!.toString() : formParams!{{/hasFormParams}}{{^hasFormParams}}null{{/hasFormParams}}{{/bodyParam}},{{/isBodyAllowed}} { + ...{{nickname}}RequestConfig?.options, {{#hasQueryParams}} params: queryParameters, {{/hasQueryParams}} @@ -293,7 +294,6 @@ export class {{classname}} { {{/isResponseFile}} withCredentials: this.configuration.withCredentials, headers: {...headers, ...{{nickname}}RequestConfig?.options?.headers}, - ...{{nickname}}RequestConfig?.options, } ); }) 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 81d8f216bf39..acda8b6091a1 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 @@ -96,9 +96,9 @@ export class PetService { return this.httpClient.post(`${this.basePath}/pet`, pet, { + ...addPetRequestConfig?.options, withCredentials: this.configuration.withCredentials, headers: {...headers, ...addPetRequestConfig?.options?.headers}, - ...addPetRequestConfig?.options, } ); }) @@ -152,9 +152,9 @@ export class PetService { return this.httpClient.delete(`${this.basePath}/pet/${encodeURIComponent(String(petId))}`, { + ...deletePetRequestConfig?.options, withCredentials: this.configuration.withCredentials, headers: {...headers, ...deletePetRequestConfig?.options?.headers}, - ...deletePetRequestConfig?.options, } ); }) @@ -211,10 +211,10 @@ export class PetService { return this.httpClient.get>(`${this.basePath}/pet/findByStatus`, { + ...findPetsByStatusRequestConfig?.options, params: queryParameters, withCredentials: this.configuration.withCredentials, headers: {...headers, ...findPetsByStatusRequestConfig?.options?.headers}, - ...findPetsByStatusRequestConfig?.options, } ); }) @@ -271,10 +271,10 @@ export class PetService { return this.httpClient.get>(`${this.basePath}/pet/findByTags`, { + ...findPetsByTagsRequestConfig?.options, params: queryParameters, withCredentials: this.configuration.withCredentials, headers: {...headers, ...findPetsByTagsRequestConfig?.options?.headers}, - ...findPetsByTagsRequestConfig?.options, } ); }) @@ -324,9 +324,9 @@ export class PetService { return this.httpClient.get(`${this.basePath}/pet/${encodeURIComponent(String(petId))}`, { + ...getPetByIdRequestConfig?.options, withCredentials: this.configuration.withCredentials, headers: {...headers, ...getPetByIdRequestConfig?.options?.headers}, - ...getPetByIdRequestConfig?.options, } ); }) @@ -385,9 +385,9 @@ export class PetService { return this.httpClient.put(`${this.basePath}/pet`, pet, { + ...updatePetRequestConfig?.options, withCredentials: this.configuration.withCredentials, headers: {...headers, ...updatePetRequestConfig?.options?.headers}, - ...updatePetRequestConfig?.options, } ); }) @@ -461,9 +461,9 @@ export class PetService { return this.httpClient.post(`${this.basePath}/pet/${encodeURIComponent(String(petId))}`, convertFormParamsToString ? formParams!.toString() : formParams!, { + ...updatePetWithFormRequestConfig?.options, withCredentials: this.configuration.withCredentials, headers: {...headers, ...updatePetWithFormRequestConfig?.options?.headers}, - ...updatePetWithFormRequestConfig?.options, } ); }) @@ -542,9 +542,9 @@ export class PetService { return this.httpClient.post(`${this.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`, convertFormParamsToString ? formParams!.toString() : formParams!, { + ...uploadFileRequestConfig?.options, withCredentials: this.configuration.withCredentials, headers: {...headers, ...uploadFileRequestConfig?.options?.headers}, - ...uploadFileRequestConfig?.options, } ); }) 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 f573851adc65..c5fc60205f2f 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 @@ -79,9 +79,9 @@ export class StoreService { return this.httpClient.delete(`${this.basePath}/store/order/${encodeURIComponent(String(orderId))}`, { + ...deleteOrderRequestConfig?.options, withCredentials: this.configuration.withCredentials, headers: {...headers, ...deleteOrderRequestConfig?.options?.headers}, - ...deleteOrderRequestConfig?.options, } ); }) @@ -125,9 +125,9 @@ export class StoreService { return this.httpClient.get<{ [key: string]: number; }>(`${this.basePath}/store/inventory`, { + ...getInventoryRequestConfig?.options, withCredentials: this.configuration.withCredentials, headers: {...headers, ...getInventoryRequestConfig?.options?.headers}, - ...getInventoryRequestConfig?.options, } ); }) @@ -172,9 +172,9 @@ export class StoreService { return this.httpClient.get(`${this.basePath}/store/order/${encodeURIComponent(String(orderId))}`, { + ...getOrderByIdRequestConfig?.options, withCredentials: this.configuration.withCredentials, headers: {...headers, ...getOrderByIdRequestConfig?.options?.headers}, - ...getOrderByIdRequestConfig?.options, } ); }) @@ -225,9 +225,9 @@ export class StoreService { return this.httpClient.post(`${this.basePath}/store/order`, order, { + ...placeOrderRequestConfig?.options, withCredentials: this.configuration.withCredentials, headers: {...headers, ...placeOrderRequestConfig?.options?.headers}, - ...placeOrderRequestConfig?.options, } ); }) 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 d531e5392ef7..8bf136dab662 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 @@ -90,9 +90,9 @@ export class UserService { return this.httpClient.post(`${this.basePath}/user`, user, { + ...createUserRequestConfig?.options, withCredentials: this.configuration.withCredentials, headers: {...headers, ...createUserRequestConfig?.options?.headers}, - ...createUserRequestConfig?.options, } ); }) @@ -146,9 +146,9 @@ export class UserService { return this.httpClient.post(`${this.basePath}/user/createWithArray`, user, { + ...createUsersWithArrayInputRequestConfig?.options, withCredentials: this.configuration.withCredentials, headers: {...headers, ...createUsersWithArrayInputRequestConfig?.options?.headers}, - ...createUsersWithArrayInputRequestConfig?.options, } ); }) @@ -202,9 +202,9 @@ export class UserService { return this.httpClient.post(`${this.basePath}/user/createWithList`, user, { + ...createUsersWithListInputRequestConfig?.options, withCredentials: this.configuration.withCredentials, headers: {...headers, ...createUsersWithListInputRequestConfig?.options?.headers}, - ...createUsersWithListInputRequestConfig?.options, } ); }) @@ -252,9 +252,9 @@ export class UserService { return this.httpClient.delete(`${this.basePath}/user/${encodeURIComponent(String(username))}`, { + ...deleteUserRequestConfig?.options, withCredentials: this.configuration.withCredentials, headers: {...headers, ...deleteUserRequestConfig?.options?.headers}, - ...deleteUserRequestConfig?.options, } ); }) @@ -299,9 +299,9 @@ export class UserService { return this.httpClient.get(`${this.basePath}/user/${encodeURIComponent(String(username))}`, { + ...getUserByNameRequestConfig?.options, withCredentials: this.configuration.withCredentials, headers: {...headers, ...getUserByNameRequestConfig?.options?.headers}, - ...getUserByNameRequestConfig?.options, } ); }) @@ -359,10 +359,10 @@ export class UserService { return this.httpClient.get(`${this.basePath}/user/login`, { + ...loginUserRequestConfig?.options, params: queryParameters, withCredentials: this.configuration.withCredentials, headers: {...headers, ...loginUserRequestConfig?.options?.headers}, - ...loginUserRequestConfig?.options, } ); }) @@ -405,9 +405,9 @@ export class UserService { return this.httpClient.get(`${this.basePath}/user/logout`, { + ...logoutUserRequestConfig?.options, withCredentials: this.configuration.withCredentials, headers: {...headers, ...logoutUserRequestConfig?.options?.headers}, - ...logoutUserRequestConfig?.options, } ); }) @@ -466,9 +466,9 @@ export class UserService { return this.httpClient.put(`${this.basePath}/user/${encodeURIComponent(String(username))}`, user, { + ...updateUserRequestConfig?.options, withCredentials: this.configuration.withCredentials, headers: {...headers, ...updateUserRequestConfig?.options?.headers}, - ...updateUserRequestConfig?.options, } ); }) 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 16d4d5d4a6b6..f63f69d33329 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 @@ -97,9 +97,9 @@ export class PetService { return this.httpClient.post(`${this.basePath}/pet`, pet, { + ...addPetRequestConfig?.options, withCredentials: this.configuration.withCredentials, headers: {...headers, ...addPetRequestConfig?.options?.headers}, - ...addPetRequestConfig?.options, } ); }) @@ -153,9 +153,9 @@ export class PetService { return this.httpClient.delete(`${this.basePath}/pet/${encodeURIComponent(String(petId))}`, { + ...deletePetRequestConfig?.options, withCredentials: this.configuration.withCredentials, headers: {...headers, ...deletePetRequestConfig?.options?.headers}, - ...deletePetRequestConfig?.options, } ); }) @@ -212,10 +212,10 @@ export class PetService { return this.httpClient.get>(`${this.basePath}/pet/findByStatus`, { + ...findPetsByStatusRequestConfig?.options, params: queryParameters, withCredentials: this.configuration.withCredentials, headers: {...headers, ...findPetsByStatusRequestConfig?.options?.headers}, - ...findPetsByStatusRequestConfig?.options, } ); }) @@ -272,10 +272,10 @@ export class PetService { return this.httpClient.get>(`${this.basePath}/pet/findByTags`, { + ...findPetsByTagsRequestConfig?.options, params: queryParameters, withCredentials: this.configuration.withCredentials, headers: {...headers, ...findPetsByTagsRequestConfig?.options?.headers}, - ...findPetsByTagsRequestConfig?.options, } ); }) @@ -325,9 +325,9 @@ export class PetService { return this.httpClient.get(`${this.basePath}/pet/${encodeURIComponent(String(petId))}`, { + ...getPetByIdRequestConfig?.options, withCredentials: this.configuration.withCredentials, headers: {...headers, ...getPetByIdRequestConfig?.options?.headers}, - ...getPetByIdRequestConfig?.options, } ); }) @@ -386,9 +386,9 @@ export class PetService { return this.httpClient.put(`${this.basePath}/pet`, pet, { + ...updatePetRequestConfig?.options, withCredentials: this.configuration.withCredentials, headers: {...headers, ...updatePetRequestConfig?.options?.headers}, - ...updatePetRequestConfig?.options, } ); }) @@ -462,9 +462,9 @@ export class PetService { return this.httpClient.post(`${this.basePath}/pet/${encodeURIComponent(String(petId))}`, convertFormParamsToString ? formParams!.toString() : formParams!, { + ...updatePetWithFormRequestConfig?.options, withCredentials: this.configuration.withCredentials, headers: {...headers, ...updatePetWithFormRequestConfig?.options?.headers}, - ...updatePetWithFormRequestConfig?.options, } ); }) @@ -543,9 +543,9 @@ export class PetService { return this.httpClient.post(`${this.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`, convertFormParamsToString ? formParams!.toString() : formParams!, { + ...uploadFileRequestConfig?.options, withCredentials: this.configuration.withCredentials, headers: {...headers, ...uploadFileRequestConfig?.options?.headers}, - ...uploadFileRequestConfig?.options, } ); }) 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 37d6eb360d9d..eafcbfbac69c 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 @@ -80,9 +80,9 @@ export class StoreService { return this.httpClient.delete(`${this.basePath}/store/order/${encodeURIComponent(String(orderId))}`, { + ...deleteOrderRequestConfig?.options, withCredentials: this.configuration.withCredentials, headers: {...headers, ...deleteOrderRequestConfig?.options?.headers}, - ...deleteOrderRequestConfig?.options, } ); }) @@ -126,9 +126,9 @@ export class StoreService { return this.httpClient.get<{ [key: string]: number; }>(`${this.basePath}/store/inventory`, { + ...getInventoryRequestConfig?.options, withCredentials: this.configuration.withCredentials, headers: {...headers, ...getInventoryRequestConfig?.options?.headers}, - ...getInventoryRequestConfig?.options, } ); }) @@ -173,9 +173,9 @@ export class StoreService { return this.httpClient.get(`${this.basePath}/store/order/${encodeURIComponent(String(orderId))}`, { + ...getOrderByIdRequestConfig?.options, withCredentials: this.configuration.withCredentials, headers: {...headers, ...getOrderByIdRequestConfig?.options?.headers}, - ...getOrderByIdRequestConfig?.options, } ); }) @@ -226,9 +226,9 @@ export class StoreService { return this.httpClient.post(`${this.basePath}/store/order`, order, { + ...placeOrderRequestConfig?.options, withCredentials: this.configuration.withCredentials, headers: {...headers, ...placeOrderRequestConfig?.options?.headers}, - ...placeOrderRequestConfig?.options, } ); }) 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 9cf76aeda8ca..b2dbc1144570 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 @@ -91,9 +91,9 @@ export class UserService { return this.httpClient.post(`${this.basePath}/user`, user, { + ...createUserRequestConfig?.options, withCredentials: this.configuration.withCredentials, headers: {...headers, ...createUserRequestConfig?.options?.headers}, - ...createUserRequestConfig?.options, } ); }) @@ -147,9 +147,9 @@ export class UserService { return this.httpClient.post(`${this.basePath}/user/createWithArray`, user, { + ...createUsersWithArrayInputRequestConfig?.options, withCredentials: this.configuration.withCredentials, headers: {...headers, ...createUsersWithArrayInputRequestConfig?.options?.headers}, - ...createUsersWithArrayInputRequestConfig?.options, } ); }) @@ -203,9 +203,9 @@ export class UserService { return this.httpClient.post(`${this.basePath}/user/createWithList`, user, { + ...createUsersWithListInputRequestConfig?.options, withCredentials: this.configuration.withCredentials, headers: {...headers, ...createUsersWithListInputRequestConfig?.options?.headers}, - ...createUsersWithListInputRequestConfig?.options, } ); }) @@ -253,9 +253,9 @@ export class UserService { return this.httpClient.delete(`${this.basePath}/user/${encodeURIComponent(String(username))}`, { + ...deleteUserRequestConfig?.options, withCredentials: this.configuration.withCredentials, headers: {...headers, ...deleteUserRequestConfig?.options?.headers}, - ...deleteUserRequestConfig?.options, } ); }) @@ -300,9 +300,9 @@ export class UserService { return this.httpClient.get(`${this.basePath}/user/${encodeURIComponent(String(username))}`, { + ...getUserByNameRequestConfig?.options, withCredentials: this.configuration.withCredentials, headers: {...headers, ...getUserByNameRequestConfig?.options?.headers}, - ...getUserByNameRequestConfig?.options, } ); }) @@ -360,10 +360,10 @@ export class UserService { return this.httpClient.get(`${this.basePath}/user/login`, { + ...loginUserRequestConfig?.options, params: queryParameters, withCredentials: this.configuration.withCredentials, headers: {...headers, ...loginUserRequestConfig?.options?.headers}, - ...loginUserRequestConfig?.options, } ); }) @@ -406,9 +406,9 @@ export class UserService { return this.httpClient.get(`${this.basePath}/user/logout`, { + ...logoutUserRequestConfig?.options, withCredentials: this.configuration.withCredentials, headers: {...headers, ...logoutUserRequestConfig?.options?.headers}, - ...logoutUserRequestConfig?.options, } ); }) @@ -467,9 +467,9 @@ export class UserService { return this.httpClient.put(`${this.basePath}/user/${encodeURIComponent(String(username))}`, user, { + ...updateUserRequestConfig?.options, withCredentials: this.configuration.withCredentials, headers: {...headers, ...updateUserRequestConfig?.options?.headers}, - ...updateUserRequestConfig?.options, } ); }) 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 ca7d4ee31833..2ff4c65eb43e 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 @@ -137,10 +137,10 @@ export class DefaultService { return this.httpClient.post(`${this.basePath}/test`, null, { + ...testReservedParamNamesRequestConfig?.options, params: queryParameters, withCredentials: this.configuration.withCredentials, headers: {...headers, ...testReservedParamNamesRequestConfig?.options?.headers}, - ...testReservedParamNamesRequestConfig?.options, } ); }) From 4eecf297e727a42421a56a117fbedc51505b109a Mon Sep 17 00:00:00 2001 From: Gregory Merlet Date: Tue, 28 Jan 2025 17:32:34 +0100 Subject: [PATCH 6/7] refactor: rename options --- .../typescript-nestjs/api.service.mustache | 14 ++-- .../builds/default/api/pet.service.ts | 80 +++++++++---------- .../builds/default/api/store.service.ts | 40 +++++----- .../builds/default/api/user.service.ts | 80 +++++++++---------- .../builds/default/api/pet.service.ts | 80 +++++++++---------- .../builds/default/api/store.service.ts | 40 +++++----- .../builds/default/api/user.service.ts | 80 +++++++++---------- .../reservedParamNames/api/default.service.ts | 10 +-- 8 files changed, 212 insertions(+), 212 deletions(-) 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 8478270540e0..7e553d48a940 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 @@ -93,15 +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}}RequestConfig.options] Override http request option. + * @param {*} [{{nickname}}Opts.config] Override http request option. */ {{#useSingleRequestParameter}} - public {{nickname}}({{#allParams.0}}requestParameters: {{classname}}{{operationIdCamelCase}}Request, {{/allParams.0}}{{nickname}}RequestConfig?: { options?: AxiosRequestConfig }): Observable>; - public {{nickname}}({{#allParams.0}}requestParameters: {{classname}}{{operationIdCamelCase}}Request, {{/allParams.0}}{{nickname}}RequestConfig?: { options?: AxiosRequestConfig }): 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}}{{nickname}}RequestConfig?: { options?: AxiosRequestConfig }): Observable>; - public {{nickname}}({{#allParams}}{{^isConstEnumParam}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/isConstEnumParam}}{{/allParams}}{{nickname}}RequestConfig?: { options?: AxiosRequestConfig }): 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}} @@ -285,7 +285,6 @@ export class {{classname}} { return this.httpClient.{{httpMethod}}{{^isResponseFile}}<{{#returnType}}{{{returnType}}}{{#isResponseTypeFile}}|undefined{{/isResponseTypeFile}}{{/returnType}}{{^returnType}}any{{/returnType}}>{{/isResponseFile}}(`${this.basePath}{{{path}}}`,{{#isBodyAllowed}} {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}{{#hasFormParams}}convertFormParamsToString ? formParams!.toString() : formParams!{{/hasFormParams}}{{^hasFormParams}}null{{/hasFormParams}}{{/bodyParam}},{{/isBodyAllowed}} { - ...{{nickname}}RequestConfig?.options, {{#hasQueryParams}} params: queryParameters, {{/hasQueryParams}} @@ -293,7 +292,8 @@ export class {{classname}} { responseType: "blob", {{/isResponseFile}} withCredentials: this.configuration.withCredentials, - headers: {...headers, ...{{nickname}}RequestConfig?.options?.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 acda8b6091a1..b5b9a371b9aa 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 @@ -49,10 +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 {*} [addPetRequestConfig.options] Override http request option. + * @param {*} [addPetOpts.config] Override http request option. */ - public addPet(pet: Pet, addPetRequestConfig?: { options?: AxiosRequestConfig }): Observable>; - public addPet(pet: Pet, addPetRequestConfig?: { options?: AxiosRequestConfig }): 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,9 +96,9 @@ export class PetService { return this.httpClient.post(`${this.basePath}/pet`, pet, { - ...addPetRequestConfig?.options, withCredentials: this.configuration.withCredentials, - headers: {...headers, ...addPetRequestConfig?.options?.headers}, + ...addPetOpts?.config, + headers: {...headers, ...addPetOpts?.config?.headers}, } ); }) @@ -111,10 +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 {*} [deletePetRequestConfig.options] Override http request option. + * @param {*} [deletePetOpts.config] Override http request option. */ - public deletePet(petId: number, apiKey?: string, deletePetRequestConfig?: { options?: AxiosRequestConfig }): Observable>; - public deletePet(petId: number, apiKey?: string, deletePetRequestConfig?: { options?: AxiosRequestConfig }): 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.'); } @@ -152,9 +152,9 @@ export class PetService { return this.httpClient.delete(`${this.basePath}/pet/${encodeURIComponent(String(petId))}`, { - ...deletePetRequestConfig?.options, withCredentials: this.configuration.withCredentials, - headers: {...headers, ...deletePetRequestConfig?.options?.headers}, + ...deletePetOpts?.config, + headers: {...headers, ...deletePetOpts?.config?.headers}, } ); }) @@ -166,10 +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 {*} [findPetsByStatusRequestConfig.options] Override http request option. + * @param {*} [findPetsByStatusOpts.config] Override http request option. */ - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, findPetsByStatusRequestConfig?: { options?: AxiosRequestConfig }): Observable>>; - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, findPetsByStatusRequestConfig?: { options?: AxiosRequestConfig }): 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.'); } @@ -211,10 +211,10 @@ export class PetService { return this.httpClient.get>(`${this.basePath}/pet/findByStatus`, { - ...findPetsByStatusRequestConfig?.options, params: queryParameters, withCredentials: this.configuration.withCredentials, - headers: {...headers, ...findPetsByStatusRequestConfig?.options?.headers}, + ...findPetsByStatusOpts?.config, + headers: {...headers, ...findPetsByStatusOpts?.config?.headers}, } ); }) @@ -226,10 +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 {*} [findPetsByTagsRequestConfig.options] Override http request option. + * @param {*} [findPetsByTagsOpts.config] Override http request option. */ - public findPetsByTags(tags: Array, findPetsByTagsRequestConfig?: { options?: AxiosRequestConfig }): Observable>>; - public findPetsByTags(tags: Array, findPetsByTagsRequestConfig?: { options?: AxiosRequestConfig }): 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.'); } @@ -271,10 +271,10 @@ export class PetService { return this.httpClient.get>(`${this.basePath}/pet/findByTags`, { - ...findPetsByTagsRequestConfig?.options, params: queryParameters, withCredentials: this.configuration.withCredentials, - headers: {...headers, ...findPetsByTagsRequestConfig?.options?.headers}, + ...findPetsByTagsOpts?.config, + headers: {...headers, ...findPetsByTagsOpts?.config?.headers}, } ); }) @@ -286,10 +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 {*} [getPetByIdRequestConfig.options] Override http request option. + * @param {*} [getPetByIdOpts.config] Override http request option. */ - public getPetById(petId: number, getPetByIdRequestConfig?: { options?: AxiosRequestConfig }): Observable>; - public getPetById(petId: number, getPetByIdRequestConfig?: { options?: AxiosRequestConfig }): 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.'); } @@ -324,9 +324,9 @@ export class PetService { return this.httpClient.get(`${this.basePath}/pet/${encodeURIComponent(String(petId))}`, { - ...getPetByIdRequestConfig?.options, withCredentials: this.configuration.withCredentials, - headers: {...headers, ...getPetByIdRequestConfig?.options?.headers}, + ...getPetByIdOpts?.config, + headers: {...headers, ...getPetByIdOpts?.config?.headers}, } ); }) @@ -338,10 +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 {*} [updatePetRequestConfig.options] Override http request option. + * @param {*} [updatePetOpts.config] Override http request option. */ - public updatePet(pet: Pet, updatePetRequestConfig?: { options?: AxiosRequestConfig }): Observable>; - public updatePet(pet: Pet, updatePetRequestConfig?: { options?: AxiosRequestConfig }): 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.'); } @@ -385,9 +385,9 @@ export class PetService { return this.httpClient.put(`${this.basePath}/pet`, pet, { - ...updatePetRequestConfig?.options, withCredentials: this.configuration.withCredentials, - headers: {...headers, ...updatePetRequestConfig?.options?.headers}, + ...updatePetOpts?.config, + headers: {...headers, ...updatePetOpts?.config?.headers}, } ); }) @@ -401,10 +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 {*} [updatePetWithFormRequestConfig.options] Override http request option. + * @param {*} [updatePetWithFormOpts.config] Override http request option. */ - public updatePetWithForm(petId: number, name?: string, status?: string, updatePetWithFormRequestConfig?: { options?: AxiosRequestConfig }): Observable>; - public updatePetWithForm(petId: number, name?: string, status?: string, updatePetWithFormRequestConfig?: { options?: AxiosRequestConfig }): 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.'); } @@ -461,9 +461,9 @@ export class PetService { return this.httpClient.post(`${this.basePath}/pet/${encodeURIComponent(String(petId))}`, convertFormParamsToString ? formParams!.toString() : formParams!, { - ...updatePetWithFormRequestConfig?.options, withCredentials: this.configuration.withCredentials, - headers: {...headers, ...updatePetWithFormRequestConfig?.options?.headers}, + ...updatePetWithFormOpts?.config, + headers: {...headers, ...updatePetWithFormOpts?.config?.headers}, } ); }) @@ -477,10 +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 {*} [uploadFileRequestConfig.options] Override http request option. + * @param {*} [uploadFileOpts.config] Override http request option. */ - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, uploadFileRequestConfig?: { options?: AxiosRequestConfig }): Observable>; - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, uploadFileRequestConfig?: { options?: AxiosRequestConfig }): 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.'); } @@ -542,9 +542,9 @@ export class PetService { return this.httpClient.post(`${this.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`, convertFormParamsToString ? formParams!.toString() : formParams!, { - ...uploadFileRequestConfig?.options, withCredentials: this.configuration.withCredentials, - headers: {...headers, ...uploadFileRequestConfig?.options?.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 c5fc60205f2f..df295275d9a0 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 @@ -48,10 +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 {*} [deleteOrderRequestConfig.options] Override http request option. + * @param {*} [deleteOrderOpts.config] Override http request option. */ - public deleteOrder(orderId: string, deleteOrderRequestConfig?: { options?: AxiosRequestConfig }): Observable>; - public deleteOrder(orderId: string, deleteOrderRequestConfig?: { options?: AxiosRequestConfig }): 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,9 +79,9 @@ export class StoreService { return this.httpClient.delete(`${this.basePath}/store/order/${encodeURIComponent(String(orderId))}`, { - ...deleteOrderRequestConfig?.options, withCredentials: this.configuration.withCredentials, - headers: {...headers, ...deleteOrderRequestConfig?.options?.headers}, + ...deleteOrderOpts?.config, + headers: {...headers, ...deleteOrderOpts?.config?.headers}, } ); }) @@ -92,10 +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 {*} [getInventoryRequestConfig.options] Override http request option. + * @param {*} [getInventoryOpts.config] Override http request option. */ - public getInventory(getInventoryRequestConfig?: { options?: AxiosRequestConfig }): Observable>; - public getInventory(getInventoryRequestConfig?: { options?: AxiosRequestConfig }): Observable { + public getInventory(getInventoryOpts?: { config?: AxiosRequestConfig }): Observable>; + public getInventory(getInventoryOpts?: { config?: AxiosRequestConfig }): Observable { let headers = {...this.defaultHeaders}; let accessTokenObservable: Observable = of(null); @@ -125,9 +125,9 @@ export class StoreService { return this.httpClient.get<{ [key: string]: number; }>(`${this.basePath}/store/inventory`, { - ...getInventoryRequestConfig?.options, withCredentials: this.configuration.withCredentials, - headers: {...headers, ...getInventoryRequestConfig?.options?.headers}, + ...getInventoryOpts?.config, + headers: {...headers, ...getInventoryOpts?.config?.headers}, } ); }) @@ -139,10 +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 {*} [getOrderByIdRequestConfig.options] Override http request option. + * @param {*} [getOrderByIdOpts.config] Override http request option. */ - public getOrderById(orderId: number, getOrderByIdRequestConfig?: { options?: AxiosRequestConfig }): Observable>; - public getOrderById(orderId: number, getOrderByIdRequestConfig?: { options?: AxiosRequestConfig }): 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.'); } @@ -172,9 +172,9 @@ export class StoreService { return this.httpClient.get(`${this.basePath}/store/order/${encodeURIComponent(String(orderId))}`, { - ...getOrderByIdRequestConfig?.options, withCredentials: this.configuration.withCredentials, - headers: {...headers, ...getOrderByIdRequestConfig?.options?.headers}, + ...getOrderByIdOpts?.config, + headers: {...headers, ...getOrderByIdOpts?.config?.headers}, } ); }) @@ -186,10 +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 {*} [placeOrderRequestConfig.options] Override http request option. + * @param {*} [placeOrderOpts.config] Override http request option. */ - public placeOrder(order: Order, placeOrderRequestConfig?: { options?: AxiosRequestConfig }): Observable>; - public placeOrder(order: Order, placeOrderRequestConfig?: { options?: AxiosRequestConfig }): 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.'); } @@ -225,9 +225,9 @@ export class StoreService { return this.httpClient.post(`${this.basePath}/store/order`, order, { - ...placeOrderRequestConfig?.options, withCredentials: this.configuration.withCredentials, - headers: {...headers, ...placeOrderRequestConfig?.options?.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 8bf136dab662..74db1081b6eb 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 @@ -48,10 +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 {*} [createUserRequestConfig.options] Override http request option. + * @param {*} [createUserOpts.config] Override http request option. */ - public createUser(user: User, createUserRequestConfig?: { options?: AxiosRequestConfig }): Observable>; - public createUser(user: User, createUserRequestConfig?: { options?: AxiosRequestConfig }): 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,9 +90,9 @@ export class UserService { return this.httpClient.post(`${this.basePath}/user`, user, { - ...createUserRequestConfig?.options, withCredentials: this.configuration.withCredentials, - headers: {...headers, ...createUserRequestConfig?.options?.headers}, + ...createUserOpts?.config, + headers: {...headers, ...createUserOpts?.config?.headers}, } ); }) @@ -104,10 +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 {*} [createUsersWithArrayInputRequestConfig.options] Override http request option. + * @param {*} [createUsersWithArrayInputOpts.config] Override http request option. */ - public createUsersWithArrayInput(user: Array, createUsersWithArrayInputRequestConfig?: { options?: AxiosRequestConfig }): Observable>; - public createUsersWithArrayInput(user: Array, createUsersWithArrayInputRequestConfig?: { options?: AxiosRequestConfig }): 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.'); } @@ -146,9 +146,9 @@ export class UserService { return this.httpClient.post(`${this.basePath}/user/createWithArray`, user, { - ...createUsersWithArrayInputRequestConfig?.options, withCredentials: this.configuration.withCredentials, - headers: {...headers, ...createUsersWithArrayInputRequestConfig?.options?.headers}, + ...createUsersWithArrayInputOpts?.config, + headers: {...headers, ...createUsersWithArrayInputOpts?.config?.headers}, } ); }) @@ -160,10 +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 {*} [createUsersWithListInputRequestConfig.options] Override http request option. + * @param {*} [createUsersWithListInputOpts.config] Override http request option. */ - public createUsersWithListInput(user: Array, createUsersWithListInputRequestConfig?: { options?: AxiosRequestConfig }): Observable>; - public createUsersWithListInput(user: Array, createUsersWithListInputRequestConfig?: { options?: AxiosRequestConfig }): 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.'); } @@ -202,9 +202,9 @@ export class UserService { return this.httpClient.post(`${this.basePath}/user/createWithList`, user, { - ...createUsersWithListInputRequestConfig?.options, withCredentials: this.configuration.withCredentials, - headers: {...headers, ...createUsersWithListInputRequestConfig?.options?.headers}, + ...createUsersWithListInputOpts?.config, + headers: {...headers, ...createUsersWithListInputOpts?.config?.headers}, } ); }) @@ -216,10 +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 {*} [deleteUserRequestConfig.options] Override http request option. + * @param {*} [deleteUserOpts.config] Override http request option. */ - public deleteUser(username: string, deleteUserRequestConfig?: { options?: AxiosRequestConfig }): Observable>; - public deleteUser(username: string, deleteUserRequestConfig?: { options?: AxiosRequestConfig }): 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.'); } @@ -252,9 +252,9 @@ export class UserService { return this.httpClient.delete(`${this.basePath}/user/${encodeURIComponent(String(username))}`, { - ...deleteUserRequestConfig?.options, withCredentials: this.configuration.withCredentials, - headers: {...headers, ...deleteUserRequestConfig?.options?.headers}, + ...deleteUserOpts?.config, + headers: {...headers, ...deleteUserOpts?.config?.headers}, } ); }) @@ -266,10 +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 {*} [getUserByNameRequestConfig.options] Override http request option. + * @param {*} [getUserByNameOpts.config] Override http request option. */ - public getUserByName(username: string, getUserByNameRequestConfig?: { options?: AxiosRequestConfig }): Observable>; - public getUserByName(username: string, getUserByNameRequestConfig?: { options?: AxiosRequestConfig }): 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.'); } @@ -299,9 +299,9 @@ export class UserService { return this.httpClient.get(`${this.basePath}/user/${encodeURIComponent(String(username))}`, { - ...getUserByNameRequestConfig?.options, withCredentials: this.configuration.withCredentials, - headers: {...headers, ...getUserByNameRequestConfig?.options?.headers}, + ...getUserByNameOpts?.config, + headers: {...headers, ...getUserByNameOpts?.config?.headers}, } ); }) @@ -314,10 +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 {*} [loginUserRequestConfig.options] Override http request option. + * @param {*} [loginUserOpts.config] Override http request option. */ - public loginUser(username: string, password: string, loginUserRequestConfig?: { options?: AxiosRequestConfig }): Observable>; - public loginUser(username: string, password: string, loginUserRequestConfig?: { options?: AxiosRequestConfig }): 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.'); } @@ -359,10 +359,10 @@ export class UserService { return this.httpClient.get(`${this.basePath}/user/login`, { - ...loginUserRequestConfig?.options, params: queryParameters, withCredentials: this.configuration.withCredentials, - headers: {...headers, ...loginUserRequestConfig?.options?.headers}, + ...loginUserOpts?.config, + headers: {...headers, ...loginUserOpts?.config?.headers}, } ); }) @@ -373,10 +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 {*} [logoutUserRequestConfig.options] Override http request option. + * @param {*} [logoutUserOpts.config] Override http request option. */ - public logoutUser(logoutUserRequestConfig?: { options?: AxiosRequestConfig }): Observable>; - public logoutUser(logoutUserRequestConfig?: { options?: AxiosRequestConfig }): Observable { + public logoutUser(logoutUserOpts?: { config?: AxiosRequestConfig }): Observable>; + public logoutUser(logoutUserOpts?: { config?: AxiosRequestConfig }): Observable { let headers = {...this.defaultHeaders}; let accessTokenObservable: Observable = of(null); @@ -405,9 +405,9 @@ export class UserService { return this.httpClient.get(`${this.basePath}/user/logout`, { - ...logoutUserRequestConfig?.options, withCredentials: this.configuration.withCredentials, - headers: {...headers, ...logoutUserRequestConfig?.options?.headers}, + ...logoutUserOpts?.config, + headers: {...headers, ...logoutUserOpts?.config?.headers}, } ); }) @@ -420,10 +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 {*} [updateUserRequestConfig.options] Override http request option. + * @param {*} [updateUserOpts.config] Override http request option. */ - public updateUser(username: string, user: User, updateUserRequestConfig?: { options?: AxiosRequestConfig }): Observable>; - public updateUser(username: string, user: User, updateUserRequestConfig?: { options?: AxiosRequestConfig }): 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.'); } @@ -466,9 +466,9 @@ export class UserService { return this.httpClient.put(`${this.basePath}/user/${encodeURIComponent(String(username))}`, user, { - ...updateUserRequestConfig?.options, withCredentials: this.configuration.withCredentials, - headers: {...headers, ...updateUserRequestConfig?.options?.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 f63f69d33329..34eb91d4694e 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 @@ -50,10 +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 {*} [addPetRequestConfig.options] Override http request option. + * @param {*} [addPetOpts.config] Override http request option. */ - public addPet(pet: Pet, addPetRequestConfig?: { options?: AxiosRequestConfig }): Observable>; - public addPet(pet: Pet, addPetRequestConfig?: { options?: AxiosRequestConfig }): 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,9 +97,9 @@ export class PetService { return this.httpClient.post(`${this.basePath}/pet`, pet, { - ...addPetRequestConfig?.options, withCredentials: this.configuration.withCredentials, - headers: {...headers, ...addPetRequestConfig?.options?.headers}, + ...addPetOpts?.config, + headers: {...headers, ...addPetOpts?.config?.headers}, } ); }) @@ -112,10 +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 {*} [deletePetRequestConfig.options] Override http request option. + * @param {*} [deletePetOpts.config] Override http request option. */ - public deletePet(petId: number, apiKey?: string, deletePetRequestConfig?: { options?: AxiosRequestConfig }): Observable>; - public deletePet(petId: number, apiKey?: string, deletePetRequestConfig?: { options?: AxiosRequestConfig }): 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.'); } @@ -153,9 +153,9 @@ export class PetService { return this.httpClient.delete(`${this.basePath}/pet/${encodeURIComponent(String(petId))}`, { - ...deletePetRequestConfig?.options, withCredentials: this.configuration.withCredentials, - headers: {...headers, ...deletePetRequestConfig?.options?.headers}, + ...deletePetOpts?.config, + headers: {...headers, ...deletePetOpts?.config?.headers}, } ); }) @@ -167,10 +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 {*} [findPetsByStatusRequestConfig.options] Override http request option. + * @param {*} [findPetsByStatusOpts.config] Override http request option. */ - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, findPetsByStatusRequestConfig?: { options?: AxiosRequestConfig }): Observable>>; - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, findPetsByStatusRequestConfig?: { options?: AxiosRequestConfig }): 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.'); } @@ -212,10 +212,10 @@ export class PetService { return this.httpClient.get>(`${this.basePath}/pet/findByStatus`, { - ...findPetsByStatusRequestConfig?.options, params: queryParameters, withCredentials: this.configuration.withCredentials, - headers: {...headers, ...findPetsByStatusRequestConfig?.options?.headers}, + ...findPetsByStatusOpts?.config, + headers: {...headers, ...findPetsByStatusOpts?.config?.headers}, } ); }) @@ -227,10 +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 {*} [findPetsByTagsRequestConfig.options] Override http request option. + * @param {*} [findPetsByTagsOpts.config] Override http request option. */ - public findPetsByTags(tags: Array, findPetsByTagsRequestConfig?: { options?: AxiosRequestConfig }): Observable>>; - public findPetsByTags(tags: Array, findPetsByTagsRequestConfig?: { options?: AxiosRequestConfig }): 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.'); } @@ -272,10 +272,10 @@ export class PetService { return this.httpClient.get>(`${this.basePath}/pet/findByTags`, { - ...findPetsByTagsRequestConfig?.options, params: queryParameters, withCredentials: this.configuration.withCredentials, - headers: {...headers, ...findPetsByTagsRequestConfig?.options?.headers}, + ...findPetsByTagsOpts?.config, + headers: {...headers, ...findPetsByTagsOpts?.config?.headers}, } ); }) @@ -287,10 +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 {*} [getPetByIdRequestConfig.options] Override http request option. + * @param {*} [getPetByIdOpts.config] Override http request option. */ - public getPetById(petId: number, getPetByIdRequestConfig?: { options?: AxiosRequestConfig }): Observable>; - public getPetById(petId: number, getPetByIdRequestConfig?: { options?: AxiosRequestConfig }): 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.'); } @@ -325,9 +325,9 @@ export class PetService { return this.httpClient.get(`${this.basePath}/pet/${encodeURIComponent(String(petId))}`, { - ...getPetByIdRequestConfig?.options, withCredentials: this.configuration.withCredentials, - headers: {...headers, ...getPetByIdRequestConfig?.options?.headers}, + ...getPetByIdOpts?.config, + headers: {...headers, ...getPetByIdOpts?.config?.headers}, } ); }) @@ -339,10 +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 {*} [updatePetRequestConfig.options] Override http request option. + * @param {*} [updatePetOpts.config] Override http request option. */ - public updatePet(pet: Pet, updatePetRequestConfig?: { options?: AxiosRequestConfig }): Observable>; - public updatePet(pet: Pet, updatePetRequestConfig?: { options?: AxiosRequestConfig }): 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.'); } @@ -386,9 +386,9 @@ export class PetService { return this.httpClient.put(`${this.basePath}/pet`, pet, { - ...updatePetRequestConfig?.options, withCredentials: this.configuration.withCredentials, - headers: {...headers, ...updatePetRequestConfig?.options?.headers}, + ...updatePetOpts?.config, + headers: {...headers, ...updatePetOpts?.config?.headers}, } ); }) @@ -402,10 +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 {*} [updatePetWithFormRequestConfig.options] Override http request option. + * @param {*} [updatePetWithFormOpts.config] Override http request option. */ - public updatePetWithForm(petId: number, name?: string, status?: string, updatePetWithFormRequestConfig?: { options?: AxiosRequestConfig }): Observable>; - public updatePetWithForm(petId: number, name?: string, status?: string, updatePetWithFormRequestConfig?: { options?: AxiosRequestConfig }): 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.'); } @@ -462,9 +462,9 @@ export class PetService { return this.httpClient.post(`${this.basePath}/pet/${encodeURIComponent(String(petId))}`, convertFormParamsToString ? formParams!.toString() : formParams!, { - ...updatePetWithFormRequestConfig?.options, withCredentials: this.configuration.withCredentials, - headers: {...headers, ...updatePetWithFormRequestConfig?.options?.headers}, + ...updatePetWithFormOpts?.config, + headers: {...headers, ...updatePetWithFormOpts?.config?.headers}, } ); }) @@ -478,10 +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 {*} [uploadFileRequestConfig.options] Override http request option. + * @param {*} [uploadFileOpts.config] Override http request option. */ - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, uploadFileRequestConfig?: { options?: AxiosRequestConfig }): Observable>; - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, uploadFileRequestConfig?: { options?: AxiosRequestConfig }): 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.'); } @@ -543,9 +543,9 @@ export class PetService { return this.httpClient.post(`${this.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`, convertFormParamsToString ? formParams!.toString() : formParams!, { - ...uploadFileRequestConfig?.options, withCredentials: this.configuration.withCredentials, - headers: {...headers, ...uploadFileRequestConfig?.options?.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 eafcbfbac69c..9189e70fc587 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 @@ -49,10 +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 {*} [deleteOrderRequestConfig.options] Override http request option. + * @param {*} [deleteOrderOpts.config] Override http request option. */ - public deleteOrder(orderId: string, deleteOrderRequestConfig?: { options?: AxiosRequestConfig }): Observable>; - public deleteOrder(orderId: string, deleteOrderRequestConfig?: { options?: AxiosRequestConfig }): 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,9 +80,9 @@ export class StoreService { return this.httpClient.delete(`${this.basePath}/store/order/${encodeURIComponent(String(orderId))}`, { - ...deleteOrderRequestConfig?.options, withCredentials: this.configuration.withCredentials, - headers: {...headers, ...deleteOrderRequestConfig?.options?.headers}, + ...deleteOrderOpts?.config, + headers: {...headers, ...deleteOrderOpts?.config?.headers}, } ); }) @@ -93,10 +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 {*} [getInventoryRequestConfig.options] Override http request option. + * @param {*} [getInventoryOpts.config] Override http request option. */ - public getInventory(getInventoryRequestConfig?: { options?: AxiosRequestConfig }): Observable>; - public getInventory(getInventoryRequestConfig?: { options?: AxiosRequestConfig }): Observable { + public getInventory(getInventoryOpts?: { config?: AxiosRequestConfig }): Observable>; + public getInventory(getInventoryOpts?: { config?: AxiosRequestConfig }): Observable { let headers = {...this.defaultHeaders}; let accessTokenObservable: Observable = of(null); @@ -126,9 +126,9 @@ export class StoreService { return this.httpClient.get<{ [key: string]: number; }>(`${this.basePath}/store/inventory`, { - ...getInventoryRequestConfig?.options, withCredentials: this.configuration.withCredentials, - headers: {...headers, ...getInventoryRequestConfig?.options?.headers}, + ...getInventoryOpts?.config, + headers: {...headers, ...getInventoryOpts?.config?.headers}, } ); }) @@ -140,10 +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 {*} [getOrderByIdRequestConfig.options] Override http request option. + * @param {*} [getOrderByIdOpts.config] Override http request option. */ - public getOrderById(orderId: number, getOrderByIdRequestConfig?: { options?: AxiosRequestConfig }): Observable>; - public getOrderById(orderId: number, getOrderByIdRequestConfig?: { options?: AxiosRequestConfig }): 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.'); } @@ -173,9 +173,9 @@ export class StoreService { return this.httpClient.get(`${this.basePath}/store/order/${encodeURIComponent(String(orderId))}`, { - ...getOrderByIdRequestConfig?.options, withCredentials: this.configuration.withCredentials, - headers: {...headers, ...getOrderByIdRequestConfig?.options?.headers}, + ...getOrderByIdOpts?.config, + headers: {...headers, ...getOrderByIdOpts?.config?.headers}, } ); }) @@ -187,10 +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 {*} [placeOrderRequestConfig.options] Override http request option. + * @param {*} [placeOrderOpts.config] Override http request option. */ - public placeOrder(order: Order, placeOrderRequestConfig?: { options?: AxiosRequestConfig }): Observable>; - public placeOrder(order: Order, placeOrderRequestConfig?: { options?: AxiosRequestConfig }): 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.'); } @@ -226,9 +226,9 @@ export class StoreService { return this.httpClient.post(`${this.basePath}/store/order`, order, { - ...placeOrderRequestConfig?.options, withCredentials: this.configuration.withCredentials, - headers: {...headers, ...placeOrderRequestConfig?.options?.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 b2dbc1144570..fa3a2a87e35e 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 @@ -49,10 +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 {*} [createUserRequestConfig.options] Override http request option. + * @param {*} [createUserOpts.config] Override http request option. */ - public createUser(user: User, createUserRequestConfig?: { options?: AxiosRequestConfig }): Observable>; - public createUser(user: User, createUserRequestConfig?: { options?: AxiosRequestConfig }): 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,9 +91,9 @@ export class UserService { return this.httpClient.post(`${this.basePath}/user`, user, { - ...createUserRequestConfig?.options, withCredentials: this.configuration.withCredentials, - headers: {...headers, ...createUserRequestConfig?.options?.headers}, + ...createUserOpts?.config, + headers: {...headers, ...createUserOpts?.config?.headers}, } ); }) @@ -105,10 +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 {*} [createUsersWithArrayInputRequestConfig.options] Override http request option. + * @param {*} [createUsersWithArrayInputOpts.config] Override http request option. */ - public createUsersWithArrayInput(user: Array, createUsersWithArrayInputRequestConfig?: { options?: AxiosRequestConfig }): Observable>; - public createUsersWithArrayInput(user: Array, createUsersWithArrayInputRequestConfig?: { options?: AxiosRequestConfig }): 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.'); } @@ -147,9 +147,9 @@ export class UserService { return this.httpClient.post(`${this.basePath}/user/createWithArray`, user, { - ...createUsersWithArrayInputRequestConfig?.options, withCredentials: this.configuration.withCredentials, - headers: {...headers, ...createUsersWithArrayInputRequestConfig?.options?.headers}, + ...createUsersWithArrayInputOpts?.config, + headers: {...headers, ...createUsersWithArrayInputOpts?.config?.headers}, } ); }) @@ -161,10 +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 {*} [createUsersWithListInputRequestConfig.options] Override http request option. + * @param {*} [createUsersWithListInputOpts.config] Override http request option. */ - public createUsersWithListInput(user: Array, createUsersWithListInputRequestConfig?: { options?: AxiosRequestConfig }): Observable>; - public createUsersWithListInput(user: Array, createUsersWithListInputRequestConfig?: { options?: AxiosRequestConfig }): 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.'); } @@ -203,9 +203,9 @@ export class UserService { return this.httpClient.post(`${this.basePath}/user/createWithList`, user, { - ...createUsersWithListInputRequestConfig?.options, withCredentials: this.configuration.withCredentials, - headers: {...headers, ...createUsersWithListInputRequestConfig?.options?.headers}, + ...createUsersWithListInputOpts?.config, + headers: {...headers, ...createUsersWithListInputOpts?.config?.headers}, } ); }) @@ -217,10 +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 {*} [deleteUserRequestConfig.options] Override http request option. + * @param {*} [deleteUserOpts.config] Override http request option. */ - public deleteUser(username: string, deleteUserRequestConfig?: { options?: AxiosRequestConfig }): Observable>; - public deleteUser(username: string, deleteUserRequestConfig?: { options?: AxiosRequestConfig }): 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.'); } @@ -253,9 +253,9 @@ export class UserService { return this.httpClient.delete(`${this.basePath}/user/${encodeURIComponent(String(username))}`, { - ...deleteUserRequestConfig?.options, withCredentials: this.configuration.withCredentials, - headers: {...headers, ...deleteUserRequestConfig?.options?.headers}, + ...deleteUserOpts?.config, + headers: {...headers, ...deleteUserOpts?.config?.headers}, } ); }) @@ -267,10 +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 {*} [getUserByNameRequestConfig.options] Override http request option. + * @param {*} [getUserByNameOpts.config] Override http request option. */ - public getUserByName(username: string, getUserByNameRequestConfig?: { options?: AxiosRequestConfig }): Observable>; - public getUserByName(username: string, getUserByNameRequestConfig?: { options?: AxiosRequestConfig }): 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.'); } @@ -300,9 +300,9 @@ export class UserService { return this.httpClient.get(`${this.basePath}/user/${encodeURIComponent(String(username))}`, { - ...getUserByNameRequestConfig?.options, withCredentials: this.configuration.withCredentials, - headers: {...headers, ...getUserByNameRequestConfig?.options?.headers}, + ...getUserByNameOpts?.config, + headers: {...headers, ...getUserByNameOpts?.config?.headers}, } ); }) @@ -315,10 +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 {*} [loginUserRequestConfig.options] Override http request option. + * @param {*} [loginUserOpts.config] Override http request option. */ - public loginUser(username: string, password: string, loginUserRequestConfig?: { options?: AxiosRequestConfig }): Observable>; - public loginUser(username: string, password: string, loginUserRequestConfig?: { options?: AxiosRequestConfig }): 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.'); } @@ -360,10 +360,10 @@ export class UserService { return this.httpClient.get(`${this.basePath}/user/login`, { - ...loginUserRequestConfig?.options, params: queryParameters, withCredentials: this.configuration.withCredentials, - headers: {...headers, ...loginUserRequestConfig?.options?.headers}, + ...loginUserOpts?.config, + headers: {...headers, ...loginUserOpts?.config?.headers}, } ); }) @@ -374,10 +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 {*} [logoutUserRequestConfig.options] Override http request option. + * @param {*} [logoutUserOpts.config] Override http request option. */ - public logoutUser(logoutUserRequestConfig?: { options?: AxiosRequestConfig }): Observable>; - public logoutUser(logoutUserRequestConfig?: { options?: AxiosRequestConfig }): Observable { + public logoutUser(logoutUserOpts?: { config?: AxiosRequestConfig }): Observable>; + public logoutUser(logoutUserOpts?: { config?: AxiosRequestConfig }): Observable { let headers = {...this.defaultHeaders}; let accessTokenObservable: Observable = of(null); @@ -406,9 +406,9 @@ export class UserService { return this.httpClient.get(`${this.basePath}/user/logout`, { - ...logoutUserRequestConfig?.options, withCredentials: this.configuration.withCredentials, - headers: {...headers, ...logoutUserRequestConfig?.options?.headers}, + ...logoutUserOpts?.config, + headers: {...headers, ...logoutUserOpts?.config?.headers}, } ); }) @@ -421,10 +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 {*} [updateUserRequestConfig.options] Override http request option. + * @param {*} [updateUserOpts.config] Override http request option. */ - public updateUser(username: string, user: User, updateUserRequestConfig?: { options?: AxiosRequestConfig }): Observable>; - public updateUser(username: string, user: User, updateUserRequestConfig?: { options?: AxiosRequestConfig }): 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.'); } @@ -467,9 +467,9 @@ export class UserService { return this.httpClient.put(`${this.basePath}/user/${encodeURIComponent(String(username))}`, user, { - ...updateUserRequestConfig?.options, withCredentials: this.configuration.withCredentials, - headers: {...headers, ...updateUserRequestConfig?.options?.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 2ff4c65eb43e..e513dad94a0e 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 @@ -74,10 +74,10 @@ export class DefaultService { * Test reserved param names * * @param {DefaultServiceTestReservedParamNamesRequest} requestParameters Request parameters. - * @param {*} [testReservedParamNamesRequestConfig.options] Override http request option. + * @param {*} [testReservedParamNamesOpts.config] Override http request option. */ - public testReservedParamNames(requestParameters: DefaultServiceTestReservedParamNamesRequest, testReservedParamNamesRequestConfig?: { options?: AxiosRequestConfig }): Observable>; - public testReservedParamNames(requestParameters: DefaultServiceTestReservedParamNamesRequest, testReservedParamNamesRequestConfig?: { options?: AxiosRequestConfig }): Observable { + public testReservedParamNames(requestParameters: DefaultServiceTestReservedParamNamesRequest, testReservedParamNamesOpts?: { config?: AxiosRequestConfig }): Observable>; + public testReservedParamNames(requestParameters: DefaultServiceTestReservedParamNamesRequest, testReservedParamNamesOpts?: { config?: AxiosRequestConfig }): Observable { const { notReserved, 'from': _from, @@ -137,10 +137,10 @@ export class DefaultService { return this.httpClient.post(`${this.basePath}/test`, null, { - ...testReservedParamNamesRequestConfig?.options, params: queryParameters, withCredentials: this.configuration.withCredentials, - headers: {...headers, ...testReservedParamNamesRequestConfig?.options?.headers}, + ...testReservedParamNamesOpts?.config, + headers: {...headers, ...testReservedParamNamesOpts?.config?.headers}, } ); }) From dd818104ae4e9e1c4266d8392b0b532297eda879 Mon Sep 17 00:00:00 2001 From: Gregory Merlet Date: Wed, 29 Jan 2025 09:51:38 +0100 Subject: [PATCH 7/7] refactor: import type --- .../src/main/resources/typescript-nestjs/api.service.mustache | 2 +- .../builds/default/api/pet.service.ts | 2 +- .../builds/default/api/store.service.ts | 2 +- .../builds/default/api/user.service.ts | 2 +- .../builds/default/api/pet.service.ts | 2 +- .../builds/default/api/store.service.ts | 2 +- .../builds/default/api/user.service.ts | 2 +- .../builds/reservedParamNames/api/default.service.ts | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) 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 7e553d48a940..87f73c75d521 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 { AxiosRequestConfig, AxiosResponse } from 'axios'; +import type { AxiosRequestConfig, AxiosResponse } from 'axios'; import { Observable, from, of, switchMap } from 'rxjs'; {{#imports}} import { {{classname}} } from '../{{filename}}'; 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 b5b9a371b9aa..81bbb54a9ca4 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 { AxiosRequestConfig, 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'; 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 df295275d9a0..ddbcb72df5eb 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 { AxiosRequestConfig, 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'; 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 74db1081b6eb..c968d4f07ce6 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 { AxiosRequestConfig, 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'; 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 34eb91d4694e..61cd6549aa03 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 { AxiosRequestConfig, 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'; 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 9189e70fc587..b3a704627f30 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 { AxiosRequestConfig, 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'; 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 fa3a2a87e35e..4332b9d3dc45 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 { AxiosRequestConfig, 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'; 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 e513dad94a0e..4741970ee3f8 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 { AxiosRequestConfig, 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';