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 ea7d0b00ee5..4f0f8dfa72a 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 @@ -103,7 +103,7 @@ export class {{classname}} { {{/queryParams}} {{/hasQueryParams}} - let headers = this.defaultHeaders; + let headers = {...this.defaultHeaders}; {{#headerParams}} {{#isArray}} if ({{paramName}}) { 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 d05d59a3b0c..ba76f58877d 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 @@ -54,7 +54,7 @@ export class PetService { throw new Error('Required parameter pet was null or undefined when calling addPet.'); } - let headers = this.defaultHeaders; + let headers = {...this.defaultHeaders}; // authentication (petstore_auth) required if (this.configuration.accessToken) { @@ -107,7 +107,7 @@ export class PetService { } - let headers = this.defaultHeaders; + let headers = {...this.defaultHeaders}; if (apiKey !== undefined && apiKey !== null) { headers['api_key'] = String(apiKey); } @@ -157,7 +157,7 @@ export class PetService { queryParameters['status'] = status.join(COLLECTION_FORMATS['csv']); } - let headers = this.defaultHeaders; + let headers = {...this.defaultHeaders}; // authentication (petstore_auth) required if (this.configuration.accessToken) { @@ -207,7 +207,7 @@ export class PetService { queryParameters['tags'] = tags.join(COLLECTION_FORMATS['csv']); } - let headers = this.defaultHeaders; + let headers = {...this.defaultHeaders}; // authentication (petstore_auth) required if (this.configuration.accessToken) { @@ -252,7 +252,7 @@ export class PetService { throw new Error('Required parameter petId was null or undefined when calling getPetById.'); } - let headers = this.defaultHeaders; + let headers = {...this.defaultHeaders}; // authentication (api_key) required if (this.configuration.apiKeys["api_key"]) { @@ -293,7 +293,7 @@ export class PetService { throw new Error('Required parameter pet was null or undefined when calling updatePet.'); } - let headers = this.defaultHeaders; + let headers = {...this.defaultHeaders}; // authentication (petstore_auth) required if (this.configuration.accessToken) { @@ -348,7 +348,7 @@ export class PetService { - let headers = this.defaultHeaders; + let headers = {...this.defaultHeaders}; // authentication (petstore_auth) required if (this.configuration.accessToken) { @@ -416,7 +416,7 @@ export class PetService { - let headers = this.defaultHeaders; + let headers = {...this.defaultHeaders}; // authentication (petstore_auth) required if (this.configuration.accessToken) { 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 cb919215836..cadb5a9048c 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 @@ -53,7 +53,7 @@ export class StoreService { throw new Error('Required parameter orderId was null or undefined when calling deleteOrder.'); } - let headers = this.defaultHeaders; + let headers = {...this.defaultHeaders}; // to determine the Accept header let httpHeaderAccepts: string[] = [ @@ -82,7 +82,7 @@ export class StoreService { public getInventory(): Observable>; public getInventory(): Observable { - let headers = this.defaultHeaders; + let headers = {...this.defaultHeaders}; // authentication (api_key) required if (this.configuration.apiKeys["api_key"]) { @@ -122,7 +122,7 @@ export class StoreService { throw new Error('Required parameter orderId was null or undefined when calling getOrderById.'); } - let headers = this.defaultHeaders; + let headers = {...this.defaultHeaders}; // to determine the Accept header let httpHeaderAccepts: string[] = [ @@ -158,7 +158,7 @@ export class StoreService { throw new Error('Required parameter order was null or undefined when calling placeOrder.'); } - let headers = this.defaultHeaders; + let headers = {...this.defaultHeaders}; // to determine the Accept header let httpHeaderAccepts: string[] = [ 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 a9f4108418d..7cac2f8bf53 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 @@ -53,7 +53,7 @@ export class UserService { throw new Error('Required parameter user was null or undefined when calling createUser.'); } - let headers = this.defaultHeaders; + let headers = {...this.defaultHeaders}; // authentication (api_key) required if (this.configuration.apiKeys["api_key"]) { @@ -98,7 +98,7 @@ export class UserService { throw new Error('Required parameter user was null or undefined when calling createUsersWithArrayInput.'); } - let headers = this.defaultHeaders; + let headers = {...this.defaultHeaders}; // authentication (api_key) required if (this.configuration.apiKeys["api_key"]) { @@ -143,7 +143,7 @@ export class UserService { throw new Error('Required parameter user was null or undefined when calling createUsersWithListInput.'); } - let headers = this.defaultHeaders; + let headers = {...this.defaultHeaders}; // authentication (api_key) required if (this.configuration.apiKeys["api_key"]) { @@ -188,7 +188,7 @@ export class UserService { throw new Error('Required parameter username was null or undefined when calling deleteUser.'); } - let headers = this.defaultHeaders; + let headers = {...this.defaultHeaders}; // authentication (api_key) required if (this.configuration.apiKeys["api_key"]) { @@ -227,7 +227,7 @@ export class UserService { throw new Error('Required parameter username was null or undefined when calling getUserByName.'); } - let headers = this.defaultHeaders; + let headers = {...this.defaultHeaders}; // to determine the Accept header let httpHeaderAccepts: string[] = [ @@ -276,7 +276,7 @@ export class UserService { queryParameters.append('password', password); } - let headers = this.defaultHeaders; + let headers = {...this.defaultHeaders}; // to determine the Accept header let httpHeaderAccepts: string[] = [ @@ -308,7 +308,7 @@ export class UserService { public logoutUser(): Observable>; public logoutUser(): Observable { - let headers = this.defaultHeaders; + let headers = {...this.defaultHeaders}; // authentication (api_key) required if (this.configuration.apiKeys["api_key"]) { @@ -352,7 +352,7 @@ export class UserService { throw new Error('Required parameter user was null or undefined when calling updateUser.'); } - let headers = this.defaultHeaders; + let headers = {...this.defaultHeaders}; // authentication (api_key) required if (this.configuration.apiKeys["api_key"]) { 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 a9edbe9d200..851eb41148c 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 @@ -55,7 +55,7 @@ export class PetService { throw new Error('Required parameter pet was null or undefined when calling addPet.'); } - let headers = this.defaultHeaders; + let headers = {...this.defaultHeaders}; // authentication (petstore_auth) required if (this.configuration.accessToken) { @@ -108,7 +108,7 @@ export class PetService { } - let headers = this.defaultHeaders; + let headers = {...this.defaultHeaders}; if (apiKey !== undefined && apiKey !== null) { headers['api_key'] = String(apiKey); } @@ -158,7 +158,7 @@ export class PetService { queryParameters['status'] = status.join(COLLECTION_FORMATS['csv']); } - let headers = this.defaultHeaders; + let headers = {...this.defaultHeaders}; // authentication (petstore_auth) required if (this.configuration.accessToken) { @@ -208,7 +208,7 @@ export class PetService { queryParameters['tags'] = tags.join(COLLECTION_FORMATS['csv']); } - let headers = this.defaultHeaders; + let headers = {...this.defaultHeaders}; // authentication (petstore_auth) required if (this.configuration.accessToken) { @@ -253,7 +253,7 @@ export class PetService { throw new Error('Required parameter petId was null or undefined when calling getPetById.'); } - let headers = this.defaultHeaders; + let headers = {...this.defaultHeaders}; // authentication (api_key) required if (this.configuration.apiKeys["api_key"]) { @@ -294,7 +294,7 @@ export class PetService { throw new Error('Required parameter pet was null or undefined when calling updatePet.'); } - let headers = this.defaultHeaders; + let headers = {...this.defaultHeaders}; // authentication (petstore_auth) required if (this.configuration.accessToken) { @@ -349,7 +349,7 @@ export class PetService { - let headers = this.defaultHeaders; + let headers = {...this.defaultHeaders}; // authentication (petstore_auth) required if (this.configuration.accessToken) { @@ -417,7 +417,7 @@ export class PetService { - let headers = this.defaultHeaders; + let headers = {...this.defaultHeaders}; // authentication (petstore_auth) required if (this.configuration.accessToken) { 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 947bae1be17..6b35126e5ba 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 @@ -54,7 +54,7 @@ export class StoreService { throw new Error('Required parameter orderId was null or undefined when calling deleteOrder.'); } - let headers = this.defaultHeaders; + let headers = {...this.defaultHeaders}; // to determine the Accept header let httpHeaderAccepts: string[] = [ @@ -83,7 +83,7 @@ export class StoreService { public getInventory(): Observable>; public getInventory(): Observable { - let headers = this.defaultHeaders; + let headers = {...this.defaultHeaders}; // authentication (api_key) required if (this.configuration.apiKeys["api_key"]) { @@ -123,7 +123,7 @@ export class StoreService { throw new Error('Required parameter orderId was null or undefined when calling getOrderById.'); } - let headers = this.defaultHeaders; + let headers = {...this.defaultHeaders}; // to determine the Accept header let httpHeaderAccepts: string[] = [ @@ -159,7 +159,7 @@ export class StoreService { throw new Error('Required parameter order was null or undefined when calling placeOrder.'); } - let headers = this.defaultHeaders; + let headers = {...this.defaultHeaders}; // to determine the Accept header let httpHeaderAccepts: string[] = [ 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 6f3c97b86e6..f5e7a5ff5c5 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 @@ -54,7 +54,7 @@ export class UserService { throw new Error('Required parameter user was null or undefined when calling createUser.'); } - let headers = this.defaultHeaders; + let headers = {...this.defaultHeaders}; // authentication (api_key) required if (this.configuration.apiKeys["api_key"]) { @@ -99,7 +99,7 @@ export class UserService { throw new Error('Required parameter user was null or undefined when calling createUsersWithArrayInput.'); } - let headers = this.defaultHeaders; + let headers = {...this.defaultHeaders}; // authentication (api_key) required if (this.configuration.apiKeys["api_key"]) { @@ -144,7 +144,7 @@ export class UserService { throw new Error('Required parameter user was null or undefined when calling createUsersWithListInput.'); } - let headers = this.defaultHeaders; + let headers = {...this.defaultHeaders}; // authentication (api_key) required if (this.configuration.apiKeys["api_key"]) { @@ -189,7 +189,7 @@ export class UserService { throw new Error('Required parameter username was null or undefined when calling deleteUser.'); } - let headers = this.defaultHeaders; + let headers = {...this.defaultHeaders}; // authentication (api_key) required if (this.configuration.apiKeys["api_key"]) { @@ -228,7 +228,7 @@ export class UserService { throw new Error('Required parameter username was null or undefined when calling getUserByName.'); } - let headers = this.defaultHeaders; + let headers = {...this.defaultHeaders}; // to determine the Accept header let httpHeaderAccepts: string[] = [ @@ -277,7 +277,7 @@ export class UserService { queryParameters.append('password', password); } - let headers = this.defaultHeaders; + let headers = {...this.defaultHeaders}; // to determine the Accept header let httpHeaderAccepts: string[] = [ @@ -309,7 +309,7 @@ export class UserService { public logoutUser(): Observable>; public logoutUser(): Observable { - let headers = this.defaultHeaders; + let headers = {...this.defaultHeaders}; // authentication (api_key) required if (this.configuration.apiKeys["api_key"]) { @@ -353,7 +353,7 @@ export class UserService { throw new Error('Required parameter user was null or undefined when calling updateUser.'); } - let headers = this.defaultHeaders; + let headers = {...this.defaultHeaders}; // authentication (api_key) required if (this.configuration.apiKeys["api_key"]) {