From 70943adf9f794544d84a087428c5c059b60df4f8 Mon Sep 17 00:00:00 2001 From: jase88 <804836+jase88@users.noreply.github.com> Date: Sun, 12 Jan 2025 21:36:52 +0100 Subject: [PATCH 1/3] fix(typescript-angular): enable "exactOptionalPropertyTypes" and ensure assignments align with type definition --- .../typescript-angular/api.service.mustache | 5 ++- .../typescript-angular/configuration.mustache | 36 +++++++++-------- .../typescript-angular/tsconfig.mustache | 2 + .../api/pet.service.ts | 5 ++- .../configuration.ts | 36 +++++++++-------- .../composed-schemas/api/pet.service.ts | 5 ++- .../builds/composed-schemas/configuration.ts | 36 +++++++++-------- .../builds/default/api/default.service.ts | 10 +++-- .../builds/default/configuration.ts | 36 +++++++++-------- .../builds/default/api/pet.service.ts | 40 +++++++++++-------- .../builds/default/api/store.service.ts | 20 ++++++---- .../builds/default/api/user.service.ts | 40 +++++++++++-------- .../builds/default/configuration.ts | 36 +++++++++-------- .../builds/default/api/pet.service.ts | 40 +++++++++++-------- .../builds/default/api/store.service.ts | 20 ++++++---- .../builds/default/api/user.service.ts | 40 +++++++++++-------- .../builds/default/configuration.ts | 36 +++++++++-------- .../builds/with-npm/api/pet.service.ts | 40 +++++++++++-------- .../builds/with-npm/api/store.service.ts | 20 ++++++---- .../builds/with-npm/api/user.service.ts | 40 +++++++++++-------- .../builds/with-npm/configuration.ts | 36 +++++++++-------- .../builds/with-npm/tsconfig.json | 2 + .../builds/default/api/default.service.ts | 10 +++-- .../builds/default/configuration.ts | 36 +++++++++-------- .../builds/default/api/pet.service.ts | 40 +++++++++++-------- .../builds/default/api/store.service.ts | 20 ++++++---- .../builds/default/api/user.service.ts | 40 +++++++++++-------- .../builds/default/configuration.ts | 36 +++++++++-------- .../builds/default/api/pet.service.ts | 40 +++++++++++-------- .../builds/default/api/store.service.ts | 20 ++++++---- .../builds/default/api/user.service.ts | 40 +++++++++++-------- .../builds/default/configuration.ts | 36 +++++++++-------- .../builds/with-npm/api/pet.service.ts | 40 +++++++++++-------- .../builds/with-npm/api/store.service.ts | 20 ++++++---- .../builds/with-npm/api/user.service.ts | 40 +++++++++++-------- .../builds/with-npm/configuration.ts | 36 +++++++++-------- .../builds/with-npm/tsconfig.json | 2 + .../builds/default/api/pet.service.ts | 40 +++++++++++-------- .../builds/default/api/store.service.ts | 20 ++++++---- .../builds/default/api/user.service.ts | 40 +++++++++++-------- .../builds/default/configuration.ts | 36 +++++++++-------- .../api/pet.service.ts | 40 +++++++++++-------- .../api/store.service.ts | 20 ++++++---- .../api/user.service.ts | 40 +++++++++++-------- .../configuration.ts | 36 +++++++++-------- .../builds/default/api/pet.service.ts | 40 +++++++++++-------- .../builds/default/api/store.service.ts | 20 ++++++---- .../builds/default/api/user.service.ts | 40 +++++++++++-------- .../builds/default/configuration.ts | 36 +++++++++-------- .../builds/default/api/pet.service.ts | 40 +++++++++++-------- .../builds/default/api/store.service.ts | 20 ++++++---- .../builds/default/api/user.service.ts | 40 +++++++++++-------- .../builds/default/configuration.ts | 36 +++++++++-------- .../builds/default/api/pet.service.ts | 40 +++++++++++-------- .../builds/default/api/store.service.ts | 20 ++++++---- .../builds/default/api/user.service.ts | 40 +++++++++++-------- .../builds/default/configuration.ts | 36 +++++++++-------- .../builds/default/api/pet.service.ts | 40 +++++++++++-------- .../builds/default/api/store.service.ts | 20 ++++++---- .../builds/default/api/user.service.ts | 40 +++++++++++-------- .../builds/default/configuration.ts | 36 +++++++++-------- .../builds/default/api/pet.service.ts | 40 +++++++++++-------- .../builds/default/api/store.service.ts | 20 ++++++---- .../builds/default/api/user.service.ts | 40 +++++++++++-------- .../builds/default/configuration.ts | 36 +++++++++-------- .../builds/default/tsconfig.json | 2 + .../builds/default/api/pet.service.ts | 40 +++++++++++-------- .../builds/default/api/store.service.ts | 20 ++++++---- .../builds/default/api/user.service.ts | 40 +++++++++++-------- .../builds/default/configuration.ts | 36 +++++++++-------- .../builds/default/tsconfig.json | 2 + 71 files changed, 1251 insertions(+), 878 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache b/modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache index ec3a695b91c0..7f7c3ecd84b8 100644 --- a/modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache @@ -378,7 +378,8 @@ export class {{classname}} { {{/isResponseFile}} let localVarPath = `{{{path}}}`; - return this.httpClient.request{{^isResponseFile}}<{{#returnType}}{{{returnType}}}{{#isResponseTypeFile}}|undefined{{/isResponseTypeFile}}{{/returnType}}{{^returnType}}any{{/returnType}}>{{/isResponseFile}}('{{httpMethod}}', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request{{^isResponseFile}}<{{#returnType}}{{{returnType}}}{{#isResponseTypeFile}}|undefined{{/isResponseTypeFile}}{{/returnType}}{{^returnType}}any{{/returnType}}>{{/isResponseFile}}('{{httpMethod}}', `${basePath}${localVarPath}`, { {{#httpContextInOptions}} context: localVarHttpContext, @@ -400,7 +401,7 @@ export class {{classname}} { {{^isResponseFile}} responseType: responseType_, {{/isResponseFile}} - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, {{#httpTransferCacheInOptions}} diff --git a/modules/openapi-generator/src/main/resources/typescript-angular/configuration.mustache b/modules/openapi-generator/src/main/resources/typescript-angular/configuration.mustache index 39f73f8e2a51..2a740cea30d2 100644 --- a/modules/openapi-generator/src/main/resources/typescript-angular/configuration.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-angular/configuration.mustache @@ -66,26 +66,30 @@ export class {{configurationClassName}} { */ credentials: {[ key: string ]: string | (() => string | undefined)}; - constructor(configurationParameters: {{configurationParametersInterfaceName}} = {}) { - this.apiKeys = configurationParameters.apiKeys; - this.username = configurationParameters.username; - this.password = configurationParameters.password; - this.accessToken = configurationParameters.accessToken; - this.basePath = configurationParameters.basePath; - this.withCredentials = configurationParameters.withCredentials; - this.encoder = configurationParameters.encoder; - if (configurationParameters.encodeParam) { - this.encodeParam = configurationParameters.encodeParam; +constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, password, username, withCredentials }: {{configurationParametersInterfaceName}} = {}) { + if (apiKeys) { + this.apiKeys = apiKeys; } - else { - this.encodeParam = param => this.defaultEncodeParam(param); + if (username) { + this.username = username; } - if (configurationParameters.credentials) { - this.credentials = configurationParameters.credentials; + if (password) { + this.password = password; } - else { - this.credentials = {}; + if (accessToken) { + this.accessToken = accessToken; } + if (basePath) { + this.basePath = basePath; + } + if (withCredentials) { + this.withCredentials = withCredentials; + } + if (encoder) { + this.encoder = encoder; + } + this.encodeParam = encodeParam ?? (param => this.defaultEncodeParam(param)); + this.credentials = credentials ?? {}; {{#authMethods}} // init default {{name}} credential diff --git a/modules/openapi-generator/src/main/resources/typescript-angular/tsconfig.mustache b/modules/openapi-generator/src/main/resources/typescript-angular/tsconfig.mustache index 98114ac5a51a..c34b4698d6a8 100644 --- a/modules/openapi-generator/src/main/resources/typescript-angular/tsconfig.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-angular/tsconfig.mustache @@ -7,6 +7,8 @@ "module": "{{#supportsES6}}es6{{/supportsES6}}{{^supportsES6}}commonjs{{/supportsES6}}", "moduleResolution": "node", "removeComments": true, + "strictNullChecks": true, + "exactOptionalPropertyTypes": true, "sourceMap": true, "outDir": "./dist", "noLib": false, diff --git a/samples/client/others/typescript-angular/builds/composed-schemas-tagged-unions/api/pet.service.ts b/samples/client/others/typescript-angular/builds/composed-schemas-tagged-unions/api/pet.service.ts index 4fca3af0365c..7cc12b5e2a17 100644 --- a/samples/client/others/typescript-angular/builds/composed-schemas-tagged-unions/api/pet.service.ts +++ b/samples/client/others/typescript-angular/builds/composed-schemas-tagged-unions/api/pet.service.ts @@ -136,11 +136,12 @@ export class PetService { } let localVarPath = `/pet/mapped`; - return this.httpClient.request>('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request>('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, diff --git a/samples/client/others/typescript-angular/builds/composed-schemas-tagged-unions/configuration.ts b/samples/client/others/typescript-angular/builds/composed-schemas-tagged-unions/configuration.ts index 526b454fb2bc..44015b69587a 100644 --- a/samples/client/others/typescript-angular/builds/composed-schemas-tagged-unions/configuration.ts +++ b/samples/client/others/typescript-angular/builds/composed-schemas-tagged-unions/configuration.ts @@ -66,26 +66,30 @@ export class Configuration { */ credentials: {[ key: string ]: string | (() => string | undefined)}; - constructor(configurationParameters: ConfigurationParameters = {}) { - this.apiKeys = configurationParameters.apiKeys; - this.username = configurationParameters.username; - this.password = configurationParameters.password; - this.accessToken = configurationParameters.accessToken; - this.basePath = configurationParameters.basePath; - this.withCredentials = configurationParameters.withCredentials; - this.encoder = configurationParameters.encoder; - if (configurationParameters.encodeParam) { - this.encodeParam = configurationParameters.encodeParam; +constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, password, username, withCredentials }: ConfigurationParameters = {}) { + if (apiKeys) { + this.apiKeys = apiKeys; } - else { - this.encodeParam = param => this.defaultEncodeParam(param); + if (username) { + this.username = username; } - if (configurationParameters.credentials) { - this.credentials = configurationParameters.credentials; + if (password) { + this.password = password; } - else { - this.credentials = {}; + if (accessToken) { + this.accessToken = accessToken; } + if (basePath) { + this.basePath = basePath; + } + if (withCredentials) { + this.withCredentials = withCredentials; + } + if (encoder) { + this.encoder = encoder; + } + this.encodeParam = encodeParam ?? (param => this.defaultEncodeParam(param)); + this.credentials = credentials ?? {}; } /** diff --git a/samples/client/others/typescript-angular/builds/composed-schemas/api/pet.service.ts b/samples/client/others/typescript-angular/builds/composed-schemas/api/pet.service.ts index 4fca3af0365c..7cc12b5e2a17 100644 --- a/samples/client/others/typescript-angular/builds/composed-schemas/api/pet.service.ts +++ b/samples/client/others/typescript-angular/builds/composed-schemas/api/pet.service.ts @@ -136,11 +136,12 @@ export class PetService { } let localVarPath = `/pet/mapped`; - return this.httpClient.request>('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request>('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, diff --git a/samples/client/others/typescript-angular/builds/composed-schemas/configuration.ts b/samples/client/others/typescript-angular/builds/composed-schemas/configuration.ts index 526b454fb2bc..44015b69587a 100644 --- a/samples/client/others/typescript-angular/builds/composed-schemas/configuration.ts +++ b/samples/client/others/typescript-angular/builds/composed-schemas/configuration.ts @@ -66,26 +66,30 @@ export class Configuration { */ credentials: {[ key: string ]: string | (() => string | undefined)}; - constructor(configurationParameters: ConfigurationParameters = {}) { - this.apiKeys = configurationParameters.apiKeys; - this.username = configurationParameters.username; - this.password = configurationParameters.password; - this.accessToken = configurationParameters.accessToken; - this.basePath = configurationParameters.basePath; - this.withCredentials = configurationParameters.withCredentials; - this.encoder = configurationParameters.encoder; - if (configurationParameters.encodeParam) { - this.encodeParam = configurationParameters.encodeParam; +constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, password, username, withCredentials }: ConfigurationParameters = {}) { + if (apiKeys) { + this.apiKeys = apiKeys; } - else { - this.encodeParam = param => this.defaultEncodeParam(param); + if (username) { + this.username = username; } - if (configurationParameters.credentials) { - this.credentials = configurationParameters.credentials; + if (password) { + this.password = password; } - else { - this.credentials = {}; + if (accessToken) { + this.accessToken = accessToken; } + if (basePath) { + this.basePath = basePath; + } + if (withCredentials) { + this.withCredentials = withCredentials; + } + if (encoder) { + this.encoder = encoder; + } + this.encodeParam = encodeParam ?? (param => this.defaultEncodeParam(param)); + this.credentials = credentials ?? {}; } /** diff --git a/samples/client/petstore/typescript-angular-v12-oneOf/builds/default/api/default.service.ts b/samples/client/petstore/typescript-angular-v12-oneOf/builds/default/api/default.service.ts index aee9f4bd8eb5..167308c61e15 100644 --- a/samples/client/petstore/typescript-angular-v12-oneOf/builds/default/api/default.service.ts +++ b/samples/client/petstore/typescript-angular-v12-oneOf/builds/default/api/default.service.ts @@ -131,11 +131,12 @@ export class DefaultService { } let localVarPath = `/`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -193,12 +194,13 @@ export class DefaultService { } let localVarPath = `/`; - return this.httpClient.request('put', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('put', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: body, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress diff --git a/samples/client/petstore/typescript-angular-v12-oneOf/builds/default/configuration.ts b/samples/client/petstore/typescript-angular-v12-oneOf/builds/default/configuration.ts index 526b454fb2bc..44015b69587a 100644 --- a/samples/client/petstore/typescript-angular-v12-oneOf/builds/default/configuration.ts +++ b/samples/client/petstore/typescript-angular-v12-oneOf/builds/default/configuration.ts @@ -66,26 +66,30 @@ export class Configuration { */ credentials: {[ key: string ]: string | (() => string | undefined)}; - constructor(configurationParameters: ConfigurationParameters = {}) { - this.apiKeys = configurationParameters.apiKeys; - this.username = configurationParameters.username; - this.password = configurationParameters.password; - this.accessToken = configurationParameters.accessToken; - this.basePath = configurationParameters.basePath; - this.withCredentials = configurationParameters.withCredentials; - this.encoder = configurationParameters.encoder; - if (configurationParameters.encodeParam) { - this.encodeParam = configurationParameters.encodeParam; +constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, password, username, withCredentials }: ConfigurationParameters = {}) { + if (apiKeys) { + this.apiKeys = apiKeys; } - else { - this.encodeParam = param => this.defaultEncodeParam(param); + if (username) { + this.username = username; } - if (configurationParameters.credentials) { - this.credentials = configurationParameters.credentials; + if (password) { + this.password = password; } - else { - this.credentials = {}; + if (accessToken) { + this.accessToken = accessToken; } + if (basePath) { + this.basePath = basePath; + } + if (withCredentials) { + this.withCredentials = withCredentials; + } + if (encoder) { + this.encoder = encoder; + } + this.encodeParam = encodeParam ?? (param => this.defaultEncodeParam(param)); + this.credentials = credentials ?? {}; } /** diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-any/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v12-provided-in-any/builds/default/api/pet.service.ts index d84622bd0658..79654a0750e5 100644 --- a/samples/client/petstore/typescript-angular-v12-provided-in-any/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v12-provided-in-any/builds/default/api/pet.service.ts @@ -167,12 +167,13 @@ export class PetService { } let localVarPath = `/pet`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: body, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -236,11 +237,12 @@ export class PetService { } let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`; - return this.httpClient.request('delete', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('delete', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -309,12 +311,13 @@ export class PetService { } let localVarPath = `/pet/findByStatus`; - return this.httpClient.request>('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request>('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, params: localVarQueryParameters, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -384,12 +387,13 @@ export class PetService { } let localVarPath = `/pet/findByTags`; - return this.httpClient.request>('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request>('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, params: localVarQueryParameters, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -452,11 +456,12 @@ export class PetService { } let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -526,12 +531,13 @@ export class PetService { } let localVarPath = `/pet`; - return this.httpClient.request('put', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('put', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: body, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -615,12 +621,13 @@ export class PetService { } let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -708,12 +715,13 @@ export class PetService { } let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}/uploadImage`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-any/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v12-provided-in-any/builds/default/api/store.service.ts index ec775facfa4e..66b79d663187 100644 --- a/samples/client/petstore/typescript-angular-v12-provided-in-any/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v12-provided-in-any/builds/default/api/store.service.ts @@ -136,11 +136,12 @@ export class StoreService { } let localVarPath = `/store/order/${this.configuration.encodeParam({name: "orderId", value: orderId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - return this.httpClient.request('delete', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('delete', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -198,11 +199,12 @@ export class StoreService { } let localVarPath = `/store/inventory`; - return this.httpClient.request<{ [key: string]: number; }>('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request<{ [key: string]: number; }>('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -258,11 +260,12 @@ export class StoreService { } let localVarPath = `/store/order/${this.configuration.encodeParam({name: "orderId", value: orderId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -325,12 +328,13 @@ export class StoreService { } let localVarPath = `/store/order`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: body, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-any/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v12-provided-in-any/builds/default/api/user.service.ts index 0d47d15dea5f..ce85e2b7d1ca 100644 --- a/samples/client/petstore/typescript-angular-v12-provided-in-any/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v12-provided-in-any/builds/default/api/user.service.ts @@ -144,12 +144,13 @@ export class UserService { } let localVarPath = `/user`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: body, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -210,12 +211,13 @@ export class UserService { } let localVarPath = `/user/createWithArray`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: body, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -276,12 +278,13 @@ export class UserService { } let localVarPath = `/user/createWithList`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: body, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -335,11 +338,12 @@ export class UserService { } let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - return this.httpClient.request('delete', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('delete', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -394,11 +398,12 @@ export class UserService { } let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -467,12 +472,13 @@ export class UserService { } let localVarPath = `/user/login`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, params: localVarQueryParameters, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -521,11 +527,12 @@ export class UserService { } let localVarPath = `/user/logout`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -591,12 +598,13 @@ export class UserService { } let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - return this.httpClient.request('put', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('put', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: body, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-any/builds/default/configuration.ts b/samples/client/petstore/typescript-angular-v12-provided-in-any/builds/default/configuration.ts index 4ad26d0bdcb9..f2021d99fa55 100644 --- a/samples/client/petstore/typescript-angular-v12-provided-in-any/builds/default/configuration.ts +++ b/samples/client/petstore/typescript-angular-v12-provided-in-any/builds/default/configuration.ts @@ -66,26 +66,30 @@ export class Configuration { */ credentials: {[ key: string ]: string | (() => string | undefined)}; - constructor(configurationParameters: ConfigurationParameters = {}) { - this.apiKeys = configurationParameters.apiKeys; - this.username = configurationParameters.username; - this.password = configurationParameters.password; - this.accessToken = configurationParameters.accessToken; - this.basePath = configurationParameters.basePath; - this.withCredentials = configurationParameters.withCredentials; - this.encoder = configurationParameters.encoder; - if (configurationParameters.encodeParam) { - this.encodeParam = configurationParameters.encodeParam; +constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, password, username, withCredentials }: ConfigurationParameters = {}) { + if (apiKeys) { + this.apiKeys = apiKeys; } - else { - this.encodeParam = param => this.defaultEncodeParam(param); + if (username) { + this.username = username; } - if (configurationParameters.credentials) { - this.credentials = configurationParameters.credentials; + if (password) { + this.password = password; } - else { - this.credentials = {}; + if (accessToken) { + this.accessToken = accessToken; } + if (basePath) { + this.basePath = basePath; + } + if (withCredentials) { + this.withCredentials = withCredentials; + } + if (encoder) { + this.encoder = encoder; + } + this.encodeParam = encodeParam ?? (param => this.defaultEncodeParam(param)); + this.credentials = credentials ?? {}; // init default petstore_auth credential if (!this.credentials['petstore_auth']) { diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/api/pet.service.ts index 8478feaad10f..195c9aeac324 100644 --- a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/api/pet.service.ts @@ -167,12 +167,13 @@ export class PetService { } let localVarPath = `/pet`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: body, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -236,11 +237,12 @@ export class PetService { } let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`; - return this.httpClient.request('delete', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('delete', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -309,12 +311,13 @@ export class PetService { } let localVarPath = `/pet/findByStatus`; - return this.httpClient.request>('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request>('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, params: localVarQueryParameters, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -384,12 +387,13 @@ export class PetService { } let localVarPath = `/pet/findByTags`; - return this.httpClient.request>('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request>('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, params: localVarQueryParameters, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -452,11 +456,12 @@ export class PetService { } let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -526,12 +531,13 @@ export class PetService { } let localVarPath = `/pet`; - return this.httpClient.request('put', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('put', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: body, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -615,12 +621,13 @@ export class PetService { } let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -708,12 +715,13 @@ export class PetService { } let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}/uploadImage`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/api/store.service.ts index 899b1a44e875..00c3702fc341 100644 --- a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/api/store.service.ts @@ -136,11 +136,12 @@ export class StoreService { } let localVarPath = `/store/order/${this.configuration.encodeParam({name: "orderId", value: orderId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - return this.httpClient.request('delete', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('delete', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -198,11 +199,12 @@ export class StoreService { } let localVarPath = `/store/inventory`; - return this.httpClient.request<{ [key: string]: number; }>('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request<{ [key: string]: number; }>('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -258,11 +260,12 @@ export class StoreService { } let localVarPath = `/store/order/${this.configuration.encodeParam({name: "orderId", value: orderId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -325,12 +328,13 @@ export class StoreService { } let localVarPath = `/store/order`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: body, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/api/user.service.ts index 22096fbb826d..42a780c3b96f 100644 --- a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/api/user.service.ts @@ -144,12 +144,13 @@ export class UserService { } let localVarPath = `/user`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: body, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -210,12 +211,13 @@ export class UserService { } let localVarPath = `/user/createWithArray`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: body, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -276,12 +278,13 @@ export class UserService { } let localVarPath = `/user/createWithList`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: body, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -335,11 +338,12 @@ export class UserService { } let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - return this.httpClient.request('delete', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('delete', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -394,11 +398,12 @@ export class UserService { } let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -467,12 +472,13 @@ export class UserService { } let localVarPath = `/user/login`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, params: localVarQueryParameters, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -521,11 +527,12 @@ export class UserService { } let localVarPath = `/user/logout`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -591,12 +598,13 @@ export class UserService { } let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - return this.httpClient.request('put', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('put', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: body, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/configuration.ts b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/configuration.ts index 4ad26d0bdcb9..f2021d99fa55 100644 --- a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/configuration.ts +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/configuration.ts @@ -66,26 +66,30 @@ export class Configuration { */ credentials: {[ key: string ]: string | (() => string | undefined)}; - constructor(configurationParameters: ConfigurationParameters = {}) { - this.apiKeys = configurationParameters.apiKeys; - this.username = configurationParameters.username; - this.password = configurationParameters.password; - this.accessToken = configurationParameters.accessToken; - this.basePath = configurationParameters.basePath; - this.withCredentials = configurationParameters.withCredentials; - this.encoder = configurationParameters.encoder; - if (configurationParameters.encodeParam) { - this.encodeParam = configurationParameters.encodeParam; +constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, password, username, withCredentials }: ConfigurationParameters = {}) { + if (apiKeys) { + this.apiKeys = apiKeys; } - else { - this.encodeParam = param => this.defaultEncodeParam(param); + if (username) { + this.username = username; } - if (configurationParameters.credentials) { - this.credentials = configurationParameters.credentials; + if (password) { + this.password = password; } - else { - this.credentials = {}; + if (accessToken) { + this.accessToken = accessToken; } + if (basePath) { + this.basePath = basePath; + } + if (withCredentials) { + this.withCredentials = withCredentials; + } + if (encoder) { + this.encoder = encoder; + } + this.encodeParam = encodeParam ?? (param => this.defaultEncodeParam(param)); + this.credentials = credentials ?? {}; // init default petstore_auth credential if (!this.credentials['petstore_auth']) { diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/api/pet.service.ts index 8478feaad10f..195c9aeac324 100644 --- a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/api/pet.service.ts @@ -167,12 +167,13 @@ export class PetService { } let localVarPath = `/pet`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: body, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -236,11 +237,12 @@ export class PetService { } let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`; - return this.httpClient.request('delete', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('delete', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -309,12 +311,13 @@ export class PetService { } let localVarPath = `/pet/findByStatus`; - return this.httpClient.request>('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request>('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, params: localVarQueryParameters, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -384,12 +387,13 @@ export class PetService { } let localVarPath = `/pet/findByTags`; - return this.httpClient.request>('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request>('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, params: localVarQueryParameters, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -452,11 +456,12 @@ export class PetService { } let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -526,12 +531,13 @@ export class PetService { } let localVarPath = `/pet`; - return this.httpClient.request('put', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('put', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: body, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -615,12 +621,13 @@ export class PetService { } let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -708,12 +715,13 @@ export class PetService { } let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}/uploadImage`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/api/store.service.ts index 899b1a44e875..00c3702fc341 100644 --- a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/api/store.service.ts @@ -136,11 +136,12 @@ export class StoreService { } let localVarPath = `/store/order/${this.configuration.encodeParam({name: "orderId", value: orderId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - return this.httpClient.request('delete', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('delete', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -198,11 +199,12 @@ export class StoreService { } let localVarPath = `/store/inventory`; - return this.httpClient.request<{ [key: string]: number; }>('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request<{ [key: string]: number; }>('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -258,11 +260,12 @@ export class StoreService { } let localVarPath = `/store/order/${this.configuration.encodeParam({name: "orderId", value: orderId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -325,12 +328,13 @@ export class StoreService { } let localVarPath = `/store/order`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: body, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/api/user.service.ts index 22096fbb826d..42a780c3b96f 100644 --- a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/api/user.service.ts @@ -144,12 +144,13 @@ export class UserService { } let localVarPath = `/user`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: body, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -210,12 +211,13 @@ export class UserService { } let localVarPath = `/user/createWithArray`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: body, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -276,12 +278,13 @@ export class UserService { } let localVarPath = `/user/createWithList`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: body, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -335,11 +338,12 @@ export class UserService { } let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - return this.httpClient.request('delete', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('delete', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -394,11 +398,12 @@ export class UserService { } let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -467,12 +472,13 @@ export class UserService { } let localVarPath = `/user/login`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, params: localVarQueryParameters, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -521,11 +527,12 @@ export class UserService { } let localVarPath = `/user/logout`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -591,12 +598,13 @@ export class UserService { } let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - return this.httpClient.request('put', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('put', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: body, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/configuration.ts b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/configuration.ts index 4ad26d0bdcb9..f2021d99fa55 100644 --- a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/configuration.ts +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/configuration.ts @@ -66,26 +66,30 @@ export class Configuration { */ credentials: {[ key: string ]: string | (() => string | undefined)}; - constructor(configurationParameters: ConfigurationParameters = {}) { - this.apiKeys = configurationParameters.apiKeys; - this.username = configurationParameters.username; - this.password = configurationParameters.password; - this.accessToken = configurationParameters.accessToken; - this.basePath = configurationParameters.basePath; - this.withCredentials = configurationParameters.withCredentials; - this.encoder = configurationParameters.encoder; - if (configurationParameters.encodeParam) { - this.encodeParam = configurationParameters.encodeParam; +constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, password, username, withCredentials }: ConfigurationParameters = {}) { + if (apiKeys) { + this.apiKeys = apiKeys; } - else { - this.encodeParam = param => this.defaultEncodeParam(param); + if (username) { + this.username = username; } - if (configurationParameters.credentials) { - this.credentials = configurationParameters.credentials; + if (password) { + this.password = password; } - else { - this.credentials = {}; + if (accessToken) { + this.accessToken = accessToken; } + if (basePath) { + this.basePath = basePath; + } + if (withCredentials) { + this.withCredentials = withCredentials; + } + if (encoder) { + this.encoder = encoder; + } + this.encodeParam = encodeParam ?? (param => this.defaultEncodeParam(param)); + this.credentials = credentials ?? {}; // init default petstore_auth credential if (!this.credentials['petstore_auth']) { diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/tsconfig.json b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/tsconfig.json index 89cdedb1cb7f..41165c30a2c9 100644 --- a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/tsconfig.json +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/tsconfig.json @@ -7,6 +7,8 @@ "module": "commonjs", "moduleResolution": "node", "removeComments": true, + "strictNullChecks": true, + "exactOptionalPropertyTypes": true, "sourceMap": true, "outDir": "./dist", "noLib": false, diff --git a/samples/client/petstore/typescript-angular-v13-oneOf/builds/default/api/default.service.ts b/samples/client/petstore/typescript-angular-v13-oneOf/builds/default/api/default.service.ts index aee9f4bd8eb5..167308c61e15 100644 --- a/samples/client/petstore/typescript-angular-v13-oneOf/builds/default/api/default.service.ts +++ b/samples/client/petstore/typescript-angular-v13-oneOf/builds/default/api/default.service.ts @@ -131,11 +131,12 @@ export class DefaultService { } let localVarPath = `/`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -193,12 +194,13 @@ export class DefaultService { } let localVarPath = `/`; - return this.httpClient.request('put', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('put', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: body, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress diff --git a/samples/client/petstore/typescript-angular-v13-oneOf/builds/default/configuration.ts b/samples/client/petstore/typescript-angular-v13-oneOf/builds/default/configuration.ts index 526b454fb2bc..44015b69587a 100644 --- a/samples/client/petstore/typescript-angular-v13-oneOf/builds/default/configuration.ts +++ b/samples/client/petstore/typescript-angular-v13-oneOf/builds/default/configuration.ts @@ -66,26 +66,30 @@ export class Configuration { */ credentials: {[ key: string ]: string | (() => string | undefined)}; - constructor(configurationParameters: ConfigurationParameters = {}) { - this.apiKeys = configurationParameters.apiKeys; - this.username = configurationParameters.username; - this.password = configurationParameters.password; - this.accessToken = configurationParameters.accessToken; - this.basePath = configurationParameters.basePath; - this.withCredentials = configurationParameters.withCredentials; - this.encoder = configurationParameters.encoder; - if (configurationParameters.encodeParam) { - this.encodeParam = configurationParameters.encodeParam; +constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, password, username, withCredentials }: ConfigurationParameters = {}) { + if (apiKeys) { + this.apiKeys = apiKeys; } - else { - this.encodeParam = param => this.defaultEncodeParam(param); + if (username) { + this.username = username; } - if (configurationParameters.credentials) { - this.credentials = configurationParameters.credentials; + if (password) { + this.password = password; } - else { - this.credentials = {}; + if (accessToken) { + this.accessToken = accessToken; } + if (basePath) { + this.basePath = basePath; + } + if (withCredentials) { + this.withCredentials = withCredentials; + } + if (encoder) { + this.encoder = encoder; + } + this.encodeParam = encodeParam ?? (param => this.defaultEncodeParam(param)); + this.credentials = credentials ?? {}; } /** diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-any/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v13-provided-in-any/builds/default/api/pet.service.ts index d84622bd0658..79654a0750e5 100644 --- a/samples/client/petstore/typescript-angular-v13-provided-in-any/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v13-provided-in-any/builds/default/api/pet.service.ts @@ -167,12 +167,13 @@ export class PetService { } let localVarPath = `/pet`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: body, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -236,11 +237,12 @@ export class PetService { } let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`; - return this.httpClient.request('delete', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('delete', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -309,12 +311,13 @@ export class PetService { } let localVarPath = `/pet/findByStatus`; - return this.httpClient.request>('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request>('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, params: localVarQueryParameters, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -384,12 +387,13 @@ export class PetService { } let localVarPath = `/pet/findByTags`; - return this.httpClient.request>('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request>('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, params: localVarQueryParameters, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -452,11 +456,12 @@ export class PetService { } let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -526,12 +531,13 @@ export class PetService { } let localVarPath = `/pet`; - return this.httpClient.request('put', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('put', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: body, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -615,12 +621,13 @@ export class PetService { } let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -708,12 +715,13 @@ export class PetService { } let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}/uploadImage`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-any/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v13-provided-in-any/builds/default/api/store.service.ts index ec775facfa4e..66b79d663187 100644 --- a/samples/client/petstore/typescript-angular-v13-provided-in-any/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v13-provided-in-any/builds/default/api/store.service.ts @@ -136,11 +136,12 @@ export class StoreService { } let localVarPath = `/store/order/${this.configuration.encodeParam({name: "orderId", value: orderId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - return this.httpClient.request('delete', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('delete', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -198,11 +199,12 @@ export class StoreService { } let localVarPath = `/store/inventory`; - return this.httpClient.request<{ [key: string]: number; }>('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request<{ [key: string]: number; }>('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -258,11 +260,12 @@ export class StoreService { } let localVarPath = `/store/order/${this.configuration.encodeParam({name: "orderId", value: orderId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -325,12 +328,13 @@ export class StoreService { } let localVarPath = `/store/order`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: body, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-any/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v13-provided-in-any/builds/default/api/user.service.ts index 0d47d15dea5f..ce85e2b7d1ca 100644 --- a/samples/client/petstore/typescript-angular-v13-provided-in-any/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v13-provided-in-any/builds/default/api/user.service.ts @@ -144,12 +144,13 @@ export class UserService { } let localVarPath = `/user`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: body, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -210,12 +211,13 @@ export class UserService { } let localVarPath = `/user/createWithArray`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: body, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -276,12 +278,13 @@ export class UserService { } let localVarPath = `/user/createWithList`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: body, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -335,11 +338,12 @@ export class UserService { } let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - return this.httpClient.request('delete', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('delete', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -394,11 +398,12 @@ export class UserService { } let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -467,12 +472,13 @@ export class UserService { } let localVarPath = `/user/login`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, params: localVarQueryParameters, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -521,11 +527,12 @@ export class UserService { } let localVarPath = `/user/logout`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -591,12 +598,13 @@ export class UserService { } let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - return this.httpClient.request('put', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('put', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: body, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-any/builds/default/configuration.ts b/samples/client/petstore/typescript-angular-v13-provided-in-any/builds/default/configuration.ts index 4ad26d0bdcb9..f2021d99fa55 100644 --- a/samples/client/petstore/typescript-angular-v13-provided-in-any/builds/default/configuration.ts +++ b/samples/client/petstore/typescript-angular-v13-provided-in-any/builds/default/configuration.ts @@ -66,26 +66,30 @@ export class Configuration { */ credentials: {[ key: string ]: string | (() => string | undefined)}; - constructor(configurationParameters: ConfigurationParameters = {}) { - this.apiKeys = configurationParameters.apiKeys; - this.username = configurationParameters.username; - this.password = configurationParameters.password; - this.accessToken = configurationParameters.accessToken; - this.basePath = configurationParameters.basePath; - this.withCredentials = configurationParameters.withCredentials; - this.encoder = configurationParameters.encoder; - if (configurationParameters.encodeParam) { - this.encodeParam = configurationParameters.encodeParam; +constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, password, username, withCredentials }: ConfigurationParameters = {}) { + if (apiKeys) { + this.apiKeys = apiKeys; } - else { - this.encodeParam = param => this.defaultEncodeParam(param); + if (username) { + this.username = username; } - if (configurationParameters.credentials) { - this.credentials = configurationParameters.credentials; + if (password) { + this.password = password; } - else { - this.credentials = {}; + if (accessToken) { + this.accessToken = accessToken; } + if (basePath) { + this.basePath = basePath; + } + if (withCredentials) { + this.withCredentials = withCredentials; + } + if (encoder) { + this.encoder = encoder; + } + this.encodeParam = encodeParam ?? (param => this.defaultEncodeParam(param)); + this.credentials = credentials ?? {}; // init default petstore_auth credential if (!this.credentials['petstore_auth']) { diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/api/pet.service.ts index cb0904f147fd..f3fa0b506326 100644 --- a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/api/pet.service.ts @@ -170,12 +170,13 @@ export class PetService { } let localVarPath = `/pet`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: pet, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -240,11 +241,12 @@ export class PetService { } let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`; - return this.httpClient.request('delete', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('delete', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -313,12 +315,13 @@ export class PetService { } let localVarPath = `/pet/findByStatus`; - return this.httpClient.request>('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request>('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, params: localVarQueryParameters, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -388,12 +391,13 @@ export class PetService { } let localVarPath = `/pet/findByTags`; - return this.httpClient.request>('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request>('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, params: localVarQueryParameters, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -456,11 +460,12 @@ export class PetService { } let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -533,12 +538,13 @@ export class PetService { } let localVarPath = `/pet`; - return this.httpClient.request('put', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('put', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: pet, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -623,12 +629,13 @@ export class PetService { } let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -717,12 +724,13 @@ export class PetService { } let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}/uploadImage`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/api/store.service.ts index 603176dff009..5f2c7a4a4540 100644 --- a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/api/store.service.ts @@ -136,11 +136,12 @@ export class StoreService { } let localVarPath = `/store/order/${this.configuration.encodeParam({name: "orderId", value: orderId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - return this.httpClient.request('delete', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('delete', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -198,11 +199,12 @@ export class StoreService { } let localVarPath = `/store/inventory`; - return this.httpClient.request<{ [key: string]: number; }>('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request<{ [key: string]: number; }>('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -258,11 +260,12 @@ export class StoreService { } let localVarPath = `/store/order/${this.configuration.encodeParam({name: "orderId", value: orderId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -327,12 +330,13 @@ export class StoreService { } let localVarPath = `/store/order`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: order, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/api/user.service.ts index 54ee534e501f..e8d3ad3195da 100644 --- a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/api/user.service.ts @@ -152,12 +152,13 @@ export class UserService { } let localVarPath = `/user`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: user, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -227,12 +228,13 @@ export class UserService { } let localVarPath = `/user/createWithArray`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: user, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -302,12 +304,13 @@ export class UserService { } let localVarPath = `/user/createWithList`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: user, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -368,11 +371,12 @@ export class UserService { } let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - return this.httpClient.request('delete', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('delete', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -428,11 +432,12 @@ export class UserService { } let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -502,12 +507,13 @@ export class UserService { } let localVarPath = `/user/login`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, params: localVarQueryParameters, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -564,11 +570,12 @@ export class UserService { } let localVarPath = `/user/logout`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -642,12 +649,13 @@ export class UserService { } let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - return this.httpClient.request('put', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('put', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: user, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/configuration.ts b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/configuration.ts index 4ad26d0bdcb9..f2021d99fa55 100644 --- a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/configuration.ts +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/configuration.ts @@ -66,26 +66,30 @@ export class Configuration { */ credentials: {[ key: string ]: string | (() => string | undefined)}; - constructor(configurationParameters: ConfigurationParameters = {}) { - this.apiKeys = configurationParameters.apiKeys; - this.username = configurationParameters.username; - this.password = configurationParameters.password; - this.accessToken = configurationParameters.accessToken; - this.basePath = configurationParameters.basePath; - this.withCredentials = configurationParameters.withCredentials; - this.encoder = configurationParameters.encoder; - if (configurationParameters.encodeParam) { - this.encodeParam = configurationParameters.encodeParam; +constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, password, username, withCredentials }: ConfigurationParameters = {}) { + if (apiKeys) { + this.apiKeys = apiKeys; } - else { - this.encodeParam = param => this.defaultEncodeParam(param); + if (username) { + this.username = username; } - if (configurationParameters.credentials) { - this.credentials = configurationParameters.credentials; + if (password) { + this.password = password; } - else { - this.credentials = {}; + if (accessToken) { + this.accessToken = accessToken; } + if (basePath) { + this.basePath = basePath; + } + if (withCredentials) { + this.withCredentials = withCredentials; + } + if (encoder) { + this.encoder = encoder; + } + this.encodeParam = encodeParam ?? (param => this.defaultEncodeParam(param)); + this.credentials = credentials ?? {}; // init default petstore_auth credential if (!this.credentials['petstore_auth']) { diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/api/pet.service.ts index cb0904f147fd..f3fa0b506326 100644 --- a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/api/pet.service.ts @@ -170,12 +170,13 @@ export class PetService { } let localVarPath = `/pet`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: pet, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -240,11 +241,12 @@ export class PetService { } let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`; - return this.httpClient.request('delete', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('delete', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -313,12 +315,13 @@ export class PetService { } let localVarPath = `/pet/findByStatus`; - return this.httpClient.request>('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request>('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, params: localVarQueryParameters, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -388,12 +391,13 @@ export class PetService { } let localVarPath = `/pet/findByTags`; - return this.httpClient.request>('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request>('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, params: localVarQueryParameters, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -456,11 +460,12 @@ export class PetService { } let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -533,12 +538,13 @@ export class PetService { } let localVarPath = `/pet`; - return this.httpClient.request('put', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('put', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: pet, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -623,12 +629,13 @@ export class PetService { } let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -717,12 +724,13 @@ export class PetService { } let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}/uploadImage`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/api/store.service.ts index 603176dff009..5f2c7a4a4540 100644 --- a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/api/store.service.ts @@ -136,11 +136,12 @@ export class StoreService { } let localVarPath = `/store/order/${this.configuration.encodeParam({name: "orderId", value: orderId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - return this.httpClient.request('delete', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('delete', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -198,11 +199,12 @@ export class StoreService { } let localVarPath = `/store/inventory`; - return this.httpClient.request<{ [key: string]: number; }>('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request<{ [key: string]: number; }>('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -258,11 +260,12 @@ export class StoreService { } let localVarPath = `/store/order/${this.configuration.encodeParam({name: "orderId", value: orderId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -327,12 +330,13 @@ export class StoreService { } let localVarPath = `/store/order`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: order, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/api/user.service.ts index 54ee534e501f..e8d3ad3195da 100644 --- a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/api/user.service.ts @@ -152,12 +152,13 @@ export class UserService { } let localVarPath = `/user`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: user, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -227,12 +228,13 @@ export class UserService { } let localVarPath = `/user/createWithArray`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: user, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -302,12 +304,13 @@ export class UserService { } let localVarPath = `/user/createWithList`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: user, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -368,11 +371,12 @@ export class UserService { } let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - return this.httpClient.request('delete', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('delete', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -428,11 +432,12 @@ export class UserService { } let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -502,12 +507,13 @@ export class UserService { } let localVarPath = `/user/login`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, params: localVarQueryParameters, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -564,11 +570,12 @@ export class UserService { } let localVarPath = `/user/logout`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -642,12 +649,13 @@ export class UserService { } let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - return this.httpClient.request('put', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('put', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: user, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/configuration.ts b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/configuration.ts index 4ad26d0bdcb9..f2021d99fa55 100644 --- a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/configuration.ts +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/configuration.ts @@ -66,26 +66,30 @@ export class Configuration { */ credentials: {[ key: string ]: string | (() => string | undefined)}; - constructor(configurationParameters: ConfigurationParameters = {}) { - this.apiKeys = configurationParameters.apiKeys; - this.username = configurationParameters.username; - this.password = configurationParameters.password; - this.accessToken = configurationParameters.accessToken; - this.basePath = configurationParameters.basePath; - this.withCredentials = configurationParameters.withCredentials; - this.encoder = configurationParameters.encoder; - if (configurationParameters.encodeParam) { - this.encodeParam = configurationParameters.encodeParam; +constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, password, username, withCredentials }: ConfigurationParameters = {}) { + if (apiKeys) { + this.apiKeys = apiKeys; } - else { - this.encodeParam = param => this.defaultEncodeParam(param); + if (username) { + this.username = username; } - if (configurationParameters.credentials) { - this.credentials = configurationParameters.credentials; + if (password) { + this.password = password; } - else { - this.credentials = {}; + if (accessToken) { + this.accessToken = accessToken; } + if (basePath) { + this.basePath = basePath; + } + if (withCredentials) { + this.withCredentials = withCredentials; + } + if (encoder) { + this.encoder = encoder; + } + this.encodeParam = encodeParam ?? (param => this.defaultEncodeParam(param)); + this.credentials = credentials ?? {}; // init default petstore_auth credential if (!this.credentials['petstore_auth']) { diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/tsconfig.json b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/tsconfig.json index 85f130ae01ef..b3049e9eee69 100644 --- a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/tsconfig.json +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/tsconfig.json @@ -7,6 +7,8 @@ "module": "es6", "moduleResolution": "node", "removeComments": true, + "strictNullChecks": true, + "exactOptionalPropertyTypes": true, "sourceMap": true, "outDir": "./dist", "noLib": false, diff --git a/samples/client/petstore/typescript-angular-v14-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v14-provided-in-root/builds/default/api/pet.service.ts index cb0904f147fd..f3fa0b506326 100644 --- a/samples/client/petstore/typescript-angular-v14-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v14-provided-in-root/builds/default/api/pet.service.ts @@ -170,12 +170,13 @@ export class PetService { } let localVarPath = `/pet`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: pet, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -240,11 +241,12 @@ export class PetService { } let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`; - return this.httpClient.request('delete', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('delete', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -313,12 +315,13 @@ export class PetService { } let localVarPath = `/pet/findByStatus`; - return this.httpClient.request>('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request>('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, params: localVarQueryParameters, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -388,12 +391,13 @@ export class PetService { } let localVarPath = `/pet/findByTags`; - return this.httpClient.request>('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request>('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, params: localVarQueryParameters, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -456,11 +460,12 @@ export class PetService { } let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -533,12 +538,13 @@ export class PetService { } let localVarPath = `/pet`; - return this.httpClient.request('put', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('put', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: pet, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -623,12 +629,13 @@ export class PetService { } let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -717,12 +724,13 @@ export class PetService { } let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}/uploadImage`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress diff --git a/samples/client/petstore/typescript-angular-v14-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v14-provided-in-root/builds/default/api/store.service.ts index 603176dff009..5f2c7a4a4540 100644 --- a/samples/client/petstore/typescript-angular-v14-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v14-provided-in-root/builds/default/api/store.service.ts @@ -136,11 +136,12 @@ export class StoreService { } let localVarPath = `/store/order/${this.configuration.encodeParam({name: "orderId", value: orderId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - return this.httpClient.request('delete', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('delete', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -198,11 +199,12 @@ export class StoreService { } let localVarPath = `/store/inventory`; - return this.httpClient.request<{ [key: string]: number; }>('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request<{ [key: string]: number; }>('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -258,11 +260,12 @@ export class StoreService { } let localVarPath = `/store/order/${this.configuration.encodeParam({name: "orderId", value: orderId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -327,12 +330,13 @@ export class StoreService { } let localVarPath = `/store/order`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: order, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress diff --git a/samples/client/petstore/typescript-angular-v14-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v14-provided-in-root/builds/default/api/user.service.ts index 54ee534e501f..e8d3ad3195da 100644 --- a/samples/client/petstore/typescript-angular-v14-provided-in-root/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v14-provided-in-root/builds/default/api/user.service.ts @@ -152,12 +152,13 @@ export class UserService { } let localVarPath = `/user`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: user, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -227,12 +228,13 @@ export class UserService { } let localVarPath = `/user/createWithArray`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: user, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -302,12 +304,13 @@ export class UserService { } let localVarPath = `/user/createWithList`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: user, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -368,11 +371,12 @@ export class UserService { } let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - return this.httpClient.request('delete', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('delete', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -428,11 +432,12 @@ export class UserService { } let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -502,12 +507,13 @@ export class UserService { } let localVarPath = `/user/login`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, params: localVarQueryParameters, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -564,11 +570,12 @@ export class UserService { } let localVarPath = `/user/logout`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -642,12 +649,13 @@ export class UserService { } let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - return this.httpClient.request('put', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('put', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: user, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress diff --git a/samples/client/petstore/typescript-angular-v14-provided-in-root/builds/default/configuration.ts b/samples/client/petstore/typescript-angular-v14-provided-in-root/builds/default/configuration.ts index 4ad26d0bdcb9..f2021d99fa55 100644 --- a/samples/client/petstore/typescript-angular-v14-provided-in-root/builds/default/configuration.ts +++ b/samples/client/petstore/typescript-angular-v14-provided-in-root/builds/default/configuration.ts @@ -66,26 +66,30 @@ export class Configuration { */ credentials: {[ key: string ]: string | (() => string | undefined)}; - constructor(configurationParameters: ConfigurationParameters = {}) { - this.apiKeys = configurationParameters.apiKeys; - this.username = configurationParameters.username; - this.password = configurationParameters.password; - this.accessToken = configurationParameters.accessToken; - this.basePath = configurationParameters.basePath; - this.withCredentials = configurationParameters.withCredentials; - this.encoder = configurationParameters.encoder; - if (configurationParameters.encodeParam) { - this.encodeParam = configurationParameters.encodeParam; +constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, password, username, withCredentials }: ConfigurationParameters = {}) { + if (apiKeys) { + this.apiKeys = apiKeys; } - else { - this.encodeParam = param => this.defaultEncodeParam(param); + if (username) { + this.username = username; } - if (configurationParameters.credentials) { - this.credentials = configurationParameters.credentials; + if (password) { + this.password = password; } - else { - this.credentials = {}; + if (accessToken) { + this.accessToken = accessToken; } + if (basePath) { + this.basePath = basePath; + } + if (withCredentials) { + this.withCredentials = withCredentials; + } + if (encoder) { + this.encoder = encoder; + } + this.encodeParam = encodeParam ?? (param => this.defaultEncodeParam(param)); + this.credentials = credentials ?? {}; // init default petstore_auth credential if (!this.credentials['petstore_auth']) { diff --git a/samples/client/petstore/typescript-angular-v14-query-param-object-format/api/pet.service.ts b/samples/client/petstore/typescript-angular-v14-query-param-object-format/api/pet.service.ts index 918dfd782b9b..6fba7910a104 100644 --- a/samples/client/petstore/typescript-angular-v14-query-param-object-format/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v14-query-param-object-format/api/pet.service.ts @@ -159,12 +159,13 @@ export class PetService { } let localVarPath = `/pet`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: pet, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -229,11 +230,12 @@ export class PetService { } let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`; - return this.httpClient.request('delete', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('delete', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -302,12 +304,13 @@ export class PetService { } let localVarPath = `/pet/findByStatus`; - return this.httpClient.request>('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request>('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, params: localVarQueryParameters, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -377,12 +380,13 @@ export class PetService { } let localVarPath = `/pet/findByTags`; - return this.httpClient.request>('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request>('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, params: localVarQueryParameters, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -445,11 +449,12 @@ export class PetService { } let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -522,12 +527,13 @@ export class PetService { } let localVarPath = `/pet`; - return this.httpClient.request('put', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('put', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: pet, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -612,12 +618,13 @@ export class PetService { } let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -706,12 +713,13 @@ export class PetService { } let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}/uploadImage`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress diff --git a/samples/client/petstore/typescript-angular-v14-query-param-object-format/api/store.service.ts b/samples/client/petstore/typescript-angular-v14-query-param-object-format/api/store.service.ts index 10507edad0b7..554e34b53e34 100644 --- a/samples/client/petstore/typescript-angular-v14-query-param-object-format/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v14-query-param-object-format/api/store.service.ts @@ -125,11 +125,12 @@ export class StoreService { } let localVarPath = `/store/order/${this.configuration.encodeParam({name: "orderId", value: orderId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - return this.httpClient.request('delete', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('delete', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -187,11 +188,12 @@ export class StoreService { } let localVarPath = `/store/inventory`; - return this.httpClient.request<{ [key: string]: number; }>('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request<{ [key: string]: number; }>('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -247,11 +249,12 @@ export class StoreService { } let localVarPath = `/store/order/${this.configuration.encodeParam({name: "orderId", value: orderId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -316,12 +319,13 @@ export class StoreService { } let localVarPath = `/store/order`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: order, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress diff --git a/samples/client/petstore/typescript-angular-v14-query-param-object-format/api/user.service.ts b/samples/client/petstore/typescript-angular-v14-query-param-object-format/api/user.service.ts index 8e369a5ae6bd..44ff276ee3f1 100644 --- a/samples/client/petstore/typescript-angular-v14-query-param-object-format/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v14-query-param-object-format/api/user.service.ts @@ -141,12 +141,13 @@ export class UserService { } let localVarPath = `/user`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: user, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -216,12 +217,13 @@ export class UserService { } let localVarPath = `/user/createWithArray`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: user, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -291,12 +293,13 @@ export class UserService { } let localVarPath = `/user/createWithList`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: user, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -357,11 +360,12 @@ export class UserService { } let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - return this.httpClient.request('delete', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('delete', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -417,11 +421,12 @@ export class UserService { } let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -491,12 +496,13 @@ export class UserService { } let localVarPath = `/user/login`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, params: localVarQueryParameters, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -553,11 +559,12 @@ export class UserService { } let localVarPath = `/user/logout`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -631,12 +638,13 @@ export class UserService { } let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - return this.httpClient.request('put', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('put', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: user, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress diff --git a/samples/client/petstore/typescript-angular-v14-query-param-object-format/configuration.ts b/samples/client/petstore/typescript-angular-v14-query-param-object-format/configuration.ts index 4ad26d0bdcb9..f2021d99fa55 100644 --- a/samples/client/petstore/typescript-angular-v14-query-param-object-format/configuration.ts +++ b/samples/client/petstore/typescript-angular-v14-query-param-object-format/configuration.ts @@ -66,26 +66,30 @@ export class Configuration { */ credentials: {[ key: string ]: string | (() => string | undefined)}; - constructor(configurationParameters: ConfigurationParameters = {}) { - this.apiKeys = configurationParameters.apiKeys; - this.username = configurationParameters.username; - this.password = configurationParameters.password; - this.accessToken = configurationParameters.accessToken; - this.basePath = configurationParameters.basePath; - this.withCredentials = configurationParameters.withCredentials; - this.encoder = configurationParameters.encoder; - if (configurationParameters.encodeParam) { - this.encodeParam = configurationParameters.encodeParam; +constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, password, username, withCredentials }: ConfigurationParameters = {}) { + if (apiKeys) { + this.apiKeys = apiKeys; } - else { - this.encodeParam = param => this.defaultEncodeParam(param); + if (username) { + this.username = username; } - if (configurationParameters.credentials) { - this.credentials = configurationParameters.credentials; + if (password) { + this.password = password; } - else { - this.credentials = {}; + if (accessToken) { + this.accessToken = accessToken; } + if (basePath) { + this.basePath = basePath; + } + if (withCredentials) { + this.withCredentials = withCredentials; + } + if (encoder) { + this.encoder = encoder; + } + this.encodeParam = encodeParam ?? (param => this.defaultEncodeParam(param)); + this.credentials = credentials ?? {}; // init default petstore_auth credential if (!this.credentials['petstore_auth']) { diff --git a/samples/client/petstore/typescript-angular-v15-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v15-provided-in-root/builds/default/api/pet.service.ts index cb0904f147fd..f3fa0b506326 100644 --- a/samples/client/petstore/typescript-angular-v15-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v15-provided-in-root/builds/default/api/pet.service.ts @@ -170,12 +170,13 @@ export class PetService { } let localVarPath = `/pet`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: pet, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -240,11 +241,12 @@ export class PetService { } let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`; - return this.httpClient.request('delete', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('delete', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -313,12 +315,13 @@ export class PetService { } let localVarPath = `/pet/findByStatus`; - return this.httpClient.request>('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request>('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, params: localVarQueryParameters, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -388,12 +391,13 @@ export class PetService { } let localVarPath = `/pet/findByTags`; - return this.httpClient.request>('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request>('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, params: localVarQueryParameters, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -456,11 +460,12 @@ export class PetService { } let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -533,12 +538,13 @@ export class PetService { } let localVarPath = `/pet`; - return this.httpClient.request('put', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('put', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: pet, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -623,12 +629,13 @@ export class PetService { } let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -717,12 +724,13 @@ export class PetService { } let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}/uploadImage`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress diff --git a/samples/client/petstore/typescript-angular-v15-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v15-provided-in-root/builds/default/api/store.service.ts index 603176dff009..5f2c7a4a4540 100644 --- a/samples/client/petstore/typescript-angular-v15-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v15-provided-in-root/builds/default/api/store.service.ts @@ -136,11 +136,12 @@ export class StoreService { } let localVarPath = `/store/order/${this.configuration.encodeParam({name: "orderId", value: orderId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - return this.httpClient.request('delete', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('delete', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -198,11 +199,12 @@ export class StoreService { } let localVarPath = `/store/inventory`; - return this.httpClient.request<{ [key: string]: number; }>('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request<{ [key: string]: number; }>('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -258,11 +260,12 @@ export class StoreService { } let localVarPath = `/store/order/${this.configuration.encodeParam({name: "orderId", value: orderId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -327,12 +330,13 @@ export class StoreService { } let localVarPath = `/store/order`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: order, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress diff --git a/samples/client/petstore/typescript-angular-v15-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v15-provided-in-root/builds/default/api/user.service.ts index 54ee534e501f..e8d3ad3195da 100644 --- a/samples/client/petstore/typescript-angular-v15-provided-in-root/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v15-provided-in-root/builds/default/api/user.service.ts @@ -152,12 +152,13 @@ export class UserService { } let localVarPath = `/user`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: user, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -227,12 +228,13 @@ export class UserService { } let localVarPath = `/user/createWithArray`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: user, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -302,12 +304,13 @@ export class UserService { } let localVarPath = `/user/createWithList`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: user, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -368,11 +371,12 @@ export class UserService { } let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - return this.httpClient.request('delete', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('delete', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -428,11 +432,12 @@ export class UserService { } let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -502,12 +507,13 @@ export class UserService { } let localVarPath = `/user/login`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, params: localVarQueryParameters, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -564,11 +570,12 @@ export class UserService { } let localVarPath = `/user/logout`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -642,12 +649,13 @@ export class UserService { } let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - return this.httpClient.request('put', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('put', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: user, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress diff --git a/samples/client/petstore/typescript-angular-v15-provided-in-root/builds/default/configuration.ts b/samples/client/petstore/typescript-angular-v15-provided-in-root/builds/default/configuration.ts index 4ad26d0bdcb9..f2021d99fa55 100644 --- a/samples/client/petstore/typescript-angular-v15-provided-in-root/builds/default/configuration.ts +++ b/samples/client/petstore/typescript-angular-v15-provided-in-root/builds/default/configuration.ts @@ -66,26 +66,30 @@ export class Configuration { */ credentials: {[ key: string ]: string | (() => string | undefined)}; - constructor(configurationParameters: ConfigurationParameters = {}) { - this.apiKeys = configurationParameters.apiKeys; - this.username = configurationParameters.username; - this.password = configurationParameters.password; - this.accessToken = configurationParameters.accessToken; - this.basePath = configurationParameters.basePath; - this.withCredentials = configurationParameters.withCredentials; - this.encoder = configurationParameters.encoder; - if (configurationParameters.encodeParam) { - this.encodeParam = configurationParameters.encodeParam; +constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, password, username, withCredentials }: ConfigurationParameters = {}) { + if (apiKeys) { + this.apiKeys = apiKeys; } - else { - this.encodeParam = param => this.defaultEncodeParam(param); + if (username) { + this.username = username; } - if (configurationParameters.credentials) { - this.credentials = configurationParameters.credentials; + if (password) { + this.password = password; } - else { - this.credentials = {}; + if (accessToken) { + this.accessToken = accessToken; } + if (basePath) { + this.basePath = basePath; + } + if (withCredentials) { + this.withCredentials = withCredentials; + } + if (encoder) { + this.encoder = encoder; + } + this.encodeParam = encodeParam ?? (param => this.defaultEncodeParam(param)); + this.credentials = credentials ?? {}; // init default petstore_auth credential if (!this.credentials['petstore_auth']) { diff --git a/samples/client/petstore/typescript-angular-v16-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v16-provided-in-root/builds/default/api/pet.service.ts index cb0904f147fd..f3fa0b506326 100644 --- a/samples/client/petstore/typescript-angular-v16-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v16-provided-in-root/builds/default/api/pet.service.ts @@ -170,12 +170,13 @@ export class PetService { } let localVarPath = `/pet`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: pet, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -240,11 +241,12 @@ export class PetService { } let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`; - return this.httpClient.request('delete', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('delete', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -313,12 +315,13 @@ export class PetService { } let localVarPath = `/pet/findByStatus`; - return this.httpClient.request>('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request>('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, params: localVarQueryParameters, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -388,12 +391,13 @@ export class PetService { } let localVarPath = `/pet/findByTags`; - return this.httpClient.request>('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request>('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, params: localVarQueryParameters, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -456,11 +460,12 @@ export class PetService { } let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -533,12 +538,13 @@ export class PetService { } let localVarPath = `/pet`; - return this.httpClient.request('put', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('put', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: pet, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -623,12 +629,13 @@ export class PetService { } let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -717,12 +724,13 @@ export class PetService { } let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}/uploadImage`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress diff --git a/samples/client/petstore/typescript-angular-v16-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v16-provided-in-root/builds/default/api/store.service.ts index 603176dff009..5f2c7a4a4540 100644 --- a/samples/client/petstore/typescript-angular-v16-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v16-provided-in-root/builds/default/api/store.service.ts @@ -136,11 +136,12 @@ export class StoreService { } let localVarPath = `/store/order/${this.configuration.encodeParam({name: "orderId", value: orderId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - return this.httpClient.request('delete', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('delete', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -198,11 +199,12 @@ export class StoreService { } let localVarPath = `/store/inventory`; - return this.httpClient.request<{ [key: string]: number; }>('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request<{ [key: string]: number; }>('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -258,11 +260,12 @@ export class StoreService { } let localVarPath = `/store/order/${this.configuration.encodeParam({name: "orderId", value: orderId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -327,12 +330,13 @@ export class StoreService { } let localVarPath = `/store/order`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: order, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress diff --git a/samples/client/petstore/typescript-angular-v16-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v16-provided-in-root/builds/default/api/user.service.ts index 54ee534e501f..e8d3ad3195da 100644 --- a/samples/client/petstore/typescript-angular-v16-provided-in-root/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v16-provided-in-root/builds/default/api/user.service.ts @@ -152,12 +152,13 @@ export class UserService { } let localVarPath = `/user`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: user, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -227,12 +228,13 @@ export class UserService { } let localVarPath = `/user/createWithArray`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: user, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -302,12 +304,13 @@ export class UserService { } let localVarPath = `/user/createWithList`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: user, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -368,11 +371,12 @@ export class UserService { } let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - return this.httpClient.request('delete', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('delete', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -428,11 +432,12 @@ export class UserService { } let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -502,12 +507,13 @@ export class UserService { } let localVarPath = `/user/login`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, params: localVarQueryParameters, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -564,11 +570,12 @@ export class UserService { } let localVarPath = `/user/logout`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress @@ -642,12 +649,13 @@ export class UserService { } let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - return this.httpClient.request('put', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('put', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: user, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, reportProgress: reportProgress diff --git a/samples/client/petstore/typescript-angular-v16-provided-in-root/builds/default/configuration.ts b/samples/client/petstore/typescript-angular-v16-provided-in-root/builds/default/configuration.ts index 4ad26d0bdcb9..f2021d99fa55 100644 --- a/samples/client/petstore/typescript-angular-v16-provided-in-root/builds/default/configuration.ts +++ b/samples/client/petstore/typescript-angular-v16-provided-in-root/builds/default/configuration.ts @@ -66,26 +66,30 @@ export class Configuration { */ credentials: {[ key: string ]: string | (() => string | undefined)}; - constructor(configurationParameters: ConfigurationParameters = {}) { - this.apiKeys = configurationParameters.apiKeys; - this.username = configurationParameters.username; - this.password = configurationParameters.password; - this.accessToken = configurationParameters.accessToken; - this.basePath = configurationParameters.basePath; - this.withCredentials = configurationParameters.withCredentials; - this.encoder = configurationParameters.encoder; - if (configurationParameters.encodeParam) { - this.encodeParam = configurationParameters.encodeParam; +constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, password, username, withCredentials }: ConfigurationParameters = {}) { + if (apiKeys) { + this.apiKeys = apiKeys; } - else { - this.encodeParam = param => this.defaultEncodeParam(param); + if (username) { + this.username = username; } - if (configurationParameters.credentials) { - this.credentials = configurationParameters.credentials; + if (password) { + this.password = password; } - else { - this.credentials = {}; + if (accessToken) { + this.accessToken = accessToken; } + if (basePath) { + this.basePath = basePath; + } + if (withCredentials) { + this.withCredentials = withCredentials; + } + if (encoder) { + this.encoder = encoder; + } + this.encodeParam = encodeParam ?? (param => this.defaultEncodeParam(param)); + this.credentials = credentials ?? {}; // init default petstore_auth credential if (!this.credentials['petstore_auth']) { diff --git a/samples/client/petstore/typescript-angular-v17-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v17-provided-in-root/builds/default/api/pet.service.ts index e4c401a2a64f..02a12264a483 100644 --- a/samples/client/petstore/typescript-angular-v17-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v17-provided-in-root/builds/default/api/pet.service.ts @@ -175,12 +175,13 @@ export class PetService { } let localVarPath = `/pet`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: pet, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, @@ -251,11 +252,12 @@ export class PetService { } let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`; - return this.httpClient.request('delete', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('delete', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, @@ -330,12 +332,13 @@ export class PetService { } let localVarPath = `/pet/findByStatus`; - return this.httpClient.request>('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request>('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, params: localVarQueryParameters, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, @@ -411,12 +414,13 @@ export class PetService { } let localVarPath = `/pet/findByTags`; - return this.httpClient.request>('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request>('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, params: localVarQueryParameters, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, @@ -485,11 +489,12 @@ export class PetService { } let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, @@ -568,12 +573,13 @@ export class PetService { } let localVarPath = `/pet`; - return this.httpClient.request('put', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('put', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: pet, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, @@ -664,12 +670,13 @@ export class PetService { } let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, @@ -764,12 +771,13 @@ export class PetService { } let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}/uploadImage`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, diff --git a/samples/client/petstore/typescript-angular-v17-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v17-provided-in-root/builds/default/api/store.service.ts index b3ab6eb55b04..a56ad798736d 100644 --- a/samples/client/petstore/typescript-angular-v17-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v17-provided-in-root/builds/default/api/store.service.ts @@ -141,11 +141,12 @@ export class StoreService { } let localVarPath = `/store/order/${this.configuration.encodeParam({name: "orderId", value: orderId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - return this.httpClient.request('delete', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('delete', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, @@ -209,11 +210,12 @@ export class StoreService { } let localVarPath = `/store/inventory`; - return this.httpClient.request<{ [key: string]: number; }>('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request<{ [key: string]: number; }>('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, @@ -275,11 +277,12 @@ export class StoreService { } let localVarPath = `/store/order/${this.configuration.encodeParam({name: "orderId", value: orderId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, @@ -350,12 +353,13 @@ export class StoreService { } let localVarPath = `/store/order`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: order, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, diff --git a/samples/client/petstore/typescript-angular-v17-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v17-provided-in-root/builds/default/api/user.service.ts index 316ece2e354d..4f6c9a540152 100644 --- a/samples/client/petstore/typescript-angular-v17-provided-in-root/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v17-provided-in-root/builds/default/api/user.service.ts @@ -157,12 +157,13 @@ export class UserService { } let localVarPath = `/user`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: user, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, @@ -238,12 +239,13 @@ export class UserService { } let localVarPath = `/user/createWithArray`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: user, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, @@ -319,12 +321,13 @@ export class UserService { } let localVarPath = `/user/createWithList`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: user, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, @@ -391,11 +394,12 @@ export class UserService { } let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - return this.httpClient.request('delete', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('delete', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, @@ -457,11 +461,12 @@ export class UserService { } let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, @@ -537,12 +542,13 @@ export class UserService { } let localVarPath = `/user/login`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, params: localVarQueryParameters, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, @@ -605,11 +611,12 @@ export class UserService { } let localVarPath = `/user/logout`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, @@ -689,12 +696,13 @@ export class UserService { } let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - return this.httpClient.request('put', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('put', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: user, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, diff --git a/samples/client/petstore/typescript-angular-v17-provided-in-root/builds/default/configuration.ts b/samples/client/petstore/typescript-angular-v17-provided-in-root/builds/default/configuration.ts index 4ad26d0bdcb9..f2021d99fa55 100644 --- a/samples/client/petstore/typescript-angular-v17-provided-in-root/builds/default/configuration.ts +++ b/samples/client/petstore/typescript-angular-v17-provided-in-root/builds/default/configuration.ts @@ -66,26 +66,30 @@ export class Configuration { */ credentials: {[ key: string ]: string | (() => string | undefined)}; - constructor(configurationParameters: ConfigurationParameters = {}) { - this.apiKeys = configurationParameters.apiKeys; - this.username = configurationParameters.username; - this.password = configurationParameters.password; - this.accessToken = configurationParameters.accessToken; - this.basePath = configurationParameters.basePath; - this.withCredentials = configurationParameters.withCredentials; - this.encoder = configurationParameters.encoder; - if (configurationParameters.encodeParam) { - this.encodeParam = configurationParameters.encodeParam; +constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, password, username, withCredentials }: ConfigurationParameters = {}) { + if (apiKeys) { + this.apiKeys = apiKeys; } - else { - this.encodeParam = param => this.defaultEncodeParam(param); + if (username) { + this.username = username; } - if (configurationParameters.credentials) { - this.credentials = configurationParameters.credentials; + if (password) { + this.password = password; } - else { - this.credentials = {}; + if (accessToken) { + this.accessToken = accessToken; } + if (basePath) { + this.basePath = basePath; + } + if (withCredentials) { + this.withCredentials = withCredentials; + } + if (encoder) { + this.encoder = encoder; + } + this.encodeParam = encodeParam ?? (param => this.defaultEncodeParam(param)); + this.credentials = credentials ?? {}; // init default petstore_auth credential if (!this.credentials['petstore_auth']) { diff --git a/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/api/pet.service.ts index e4c401a2a64f..02a12264a483 100644 --- a/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/api/pet.service.ts @@ -175,12 +175,13 @@ export class PetService { } let localVarPath = `/pet`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: pet, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, @@ -251,11 +252,12 @@ export class PetService { } let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`; - return this.httpClient.request('delete', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('delete', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, @@ -330,12 +332,13 @@ export class PetService { } let localVarPath = `/pet/findByStatus`; - return this.httpClient.request>('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request>('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, params: localVarQueryParameters, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, @@ -411,12 +414,13 @@ export class PetService { } let localVarPath = `/pet/findByTags`; - return this.httpClient.request>('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request>('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, params: localVarQueryParameters, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, @@ -485,11 +489,12 @@ export class PetService { } let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, @@ -568,12 +573,13 @@ export class PetService { } let localVarPath = `/pet`; - return this.httpClient.request('put', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('put', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: pet, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, @@ -664,12 +670,13 @@ export class PetService { } let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, @@ -764,12 +771,13 @@ export class PetService { } let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}/uploadImage`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, diff --git a/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/api/store.service.ts index b3ab6eb55b04..a56ad798736d 100644 --- a/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/api/store.service.ts @@ -141,11 +141,12 @@ export class StoreService { } let localVarPath = `/store/order/${this.configuration.encodeParam({name: "orderId", value: orderId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - return this.httpClient.request('delete', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('delete', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, @@ -209,11 +210,12 @@ export class StoreService { } let localVarPath = `/store/inventory`; - return this.httpClient.request<{ [key: string]: number; }>('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request<{ [key: string]: number; }>('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, @@ -275,11 +277,12 @@ export class StoreService { } let localVarPath = `/store/order/${this.configuration.encodeParam({name: "orderId", value: orderId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, @@ -350,12 +353,13 @@ export class StoreService { } let localVarPath = `/store/order`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: order, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, diff --git a/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/api/user.service.ts index 316ece2e354d..4f6c9a540152 100644 --- a/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/api/user.service.ts @@ -157,12 +157,13 @@ export class UserService { } let localVarPath = `/user`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: user, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, @@ -238,12 +239,13 @@ export class UserService { } let localVarPath = `/user/createWithArray`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: user, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, @@ -319,12 +321,13 @@ export class UserService { } let localVarPath = `/user/createWithList`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: user, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, @@ -391,11 +394,12 @@ export class UserService { } let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - return this.httpClient.request('delete', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('delete', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, @@ -457,11 +461,12 @@ export class UserService { } let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, @@ -537,12 +542,13 @@ export class UserService { } let localVarPath = `/user/login`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, params: localVarQueryParameters, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, @@ -605,11 +611,12 @@ export class UserService { } let localVarPath = `/user/logout`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, @@ -689,12 +696,13 @@ export class UserService { } let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - return this.httpClient.request('put', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('put', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: user, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, diff --git a/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/configuration.ts b/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/configuration.ts index 4ad26d0bdcb9..f2021d99fa55 100644 --- a/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/configuration.ts +++ b/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/configuration.ts @@ -66,26 +66,30 @@ export class Configuration { */ credentials: {[ key: string ]: string | (() => string | undefined)}; - constructor(configurationParameters: ConfigurationParameters = {}) { - this.apiKeys = configurationParameters.apiKeys; - this.username = configurationParameters.username; - this.password = configurationParameters.password; - this.accessToken = configurationParameters.accessToken; - this.basePath = configurationParameters.basePath; - this.withCredentials = configurationParameters.withCredentials; - this.encoder = configurationParameters.encoder; - if (configurationParameters.encodeParam) { - this.encodeParam = configurationParameters.encodeParam; +constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, password, username, withCredentials }: ConfigurationParameters = {}) { + if (apiKeys) { + this.apiKeys = apiKeys; } - else { - this.encodeParam = param => this.defaultEncodeParam(param); + if (username) { + this.username = username; } - if (configurationParameters.credentials) { - this.credentials = configurationParameters.credentials; + if (password) { + this.password = password; } - else { - this.credentials = {}; + if (accessToken) { + this.accessToken = accessToken; } + if (basePath) { + this.basePath = basePath; + } + if (withCredentials) { + this.withCredentials = withCredentials; + } + if (encoder) { + this.encoder = encoder; + } + this.encodeParam = encodeParam ?? (param => this.defaultEncodeParam(param)); + this.credentials = credentials ?? {}; // init default petstore_auth credential if (!this.credentials['petstore_auth']) { diff --git a/samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/api/pet.service.ts index e4c401a2a64f..02a12264a483 100644 --- a/samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/api/pet.service.ts @@ -175,12 +175,13 @@ export class PetService { } let localVarPath = `/pet`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: pet, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, @@ -251,11 +252,12 @@ export class PetService { } let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`; - return this.httpClient.request('delete', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('delete', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, @@ -330,12 +332,13 @@ export class PetService { } let localVarPath = `/pet/findByStatus`; - return this.httpClient.request>('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request>('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, params: localVarQueryParameters, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, @@ -411,12 +414,13 @@ export class PetService { } let localVarPath = `/pet/findByTags`; - return this.httpClient.request>('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request>('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, params: localVarQueryParameters, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, @@ -485,11 +489,12 @@ export class PetService { } let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, @@ -568,12 +573,13 @@ export class PetService { } let localVarPath = `/pet`; - return this.httpClient.request('put', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('put', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: pet, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, @@ -664,12 +670,13 @@ export class PetService { } let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, @@ -764,12 +771,13 @@ export class PetService { } let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}/uploadImage`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, diff --git a/samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/api/store.service.ts index b3ab6eb55b04..a56ad798736d 100644 --- a/samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/api/store.service.ts @@ -141,11 +141,12 @@ export class StoreService { } let localVarPath = `/store/order/${this.configuration.encodeParam({name: "orderId", value: orderId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - return this.httpClient.request('delete', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('delete', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, @@ -209,11 +210,12 @@ export class StoreService { } let localVarPath = `/store/inventory`; - return this.httpClient.request<{ [key: string]: number; }>('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request<{ [key: string]: number; }>('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, @@ -275,11 +277,12 @@ export class StoreService { } let localVarPath = `/store/order/${this.configuration.encodeParam({name: "orderId", value: orderId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, @@ -350,12 +353,13 @@ export class StoreService { } let localVarPath = `/store/order`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: order, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, diff --git a/samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/api/user.service.ts index 316ece2e354d..4f6c9a540152 100644 --- a/samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/api/user.service.ts @@ -157,12 +157,13 @@ export class UserService { } let localVarPath = `/user`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: user, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, @@ -238,12 +239,13 @@ export class UserService { } let localVarPath = `/user/createWithArray`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: user, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, @@ -319,12 +321,13 @@ export class UserService { } let localVarPath = `/user/createWithList`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: user, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, @@ -391,11 +394,12 @@ export class UserService { } let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - return this.httpClient.request('delete', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('delete', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, @@ -457,11 +461,12 @@ export class UserService { } let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, @@ -537,12 +542,13 @@ export class UserService { } let localVarPath = `/user/login`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, params: localVarQueryParameters, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, @@ -605,11 +611,12 @@ export class UserService { } let localVarPath = `/user/logout`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, @@ -689,12 +696,13 @@ export class UserService { } let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - return this.httpClient.request('put', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('put', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: user, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, diff --git a/samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/configuration.ts b/samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/configuration.ts index 4ad26d0bdcb9..f2021d99fa55 100644 --- a/samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/configuration.ts +++ b/samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/configuration.ts @@ -66,26 +66,30 @@ export class Configuration { */ credentials: {[ key: string ]: string | (() => string | undefined)}; - constructor(configurationParameters: ConfigurationParameters = {}) { - this.apiKeys = configurationParameters.apiKeys; - this.username = configurationParameters.username; - this.password = configurationParameters.password; - this.accessToken = configurationParameters.accessToken; - this.basePath = configurationParameters.basePath; - this.withCredentials = configurationParameters.withCredentials; - this.encoder = configurationParameters.encoder; - if (configurationParameters.encodeParam) { - this.encodeParam = configurationParameters.encodeParam; +constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, password, username, withCredentials }: ConfigurationParameters = {}) { + if (apiKeys) { + this.apiKeys = apiKeys; } - else { - this.encodeParam = param => this.defaultEncodeParam(param); + if (username) { + this.username = username; } - if (configurationParameters.credentials) { - this.credentials = configurationParameters.credentials; + if (password) { + this.password = password; } - else { - this.credentials = {}; + if (accessToken) { + this.accessToken = accessToken; } + if (basePath) { + this.basePath = basePath; + } + if (withCredentials) { + this.withCredentials = withCredentials; + } + if (encoder) { + this.encoder = encoder; + } + this.encodeParam = encodeParam ?? (param => this.defaultEncodeParam(param)); + this.credentials = credentials ?? {}; // init default petstore_auth credential if (!this.credentials['petstore_auth']) { diff --git a/samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/tsconfig.json b/samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/tsconfig.json index 85f130ae01ef..b3049e9eee69 100644 --- a/samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/tsconfig.json +++ b/samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/tsconfig.json @@ -7,6 +7,8 @@ "module": "es6", "moduleResolution": "node", "removeComments": true, + "strictNullChecks": true, + "exactOptionalPropertyTypes": true, "sourceMap": true, "outDir": "./dist", "noLib": false, diff --git a/samples/client/petstore/typescript-angular-v19/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v19/builds/default/api/pet.service.ts index e4c401a2a64f..02a12264a483 100644 --- a/samples/client/petstore/typescript-angular-v19/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v19/builds/default/api/pet.service.ts @@ -175,12 +175,13 @@ export class PetService { } let localVarPath = `/pet`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: pet, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, @@ -251,11 +252,12 @@ export class PetService { } let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`; - return this.httpClient.request('delete', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('delete', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, @@ -330,12 +332,13 @@ export class PetService { } let localVarPath = `/pet/findByStatus`; - return this.httpClient.request>('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request>('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, params: localVarQueryParameters, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, @@ -411,12 +414,13 @@ export class PetService { } let localVarPath = `/pet/findByTags`; - return this.httpClient.request>('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request>('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, params: localVarQueryParameters, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, @@ -485,11 +489,12 @@ export class PetService { } let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, @@ -568,12 +573,13 @@ export class PetService { } let localVarPath = `/pet`; - return this.httpClient.request('put', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('put', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: pet, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, @@ -664,12 +670,13 @@ export class PetService { } let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, @@ -764,12 +771,13 @@ export class PetService { } let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}/uploadImage`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, diff --git a/samples/client/petstore/typescript-angular-v19/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v19/builds/default/api/store.service.ts index b3ab6eb55b04..a56ad798736d 100644 --- a/samples/client/petstore/typescript-angular-v19/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v19/builds/default/api/store.service.ts @@ -141,11 +141,12 @@ export class StoreService { } let localVarPath = `/store/order/${this.configuration.encodeParam({name: "orderId", value: orderId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - return this.httpClient.request('delete', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('delete', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, @@ -209,11 +210,12 @@ export class StoreService { } let localVarPath = `/store/inventory`; - return this.httpClient.request<{ [key: string]: number; }>('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request<{ [key: string]: number; }>('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, @@ -275,11 +277,12 @@ export class StoreService { } let localVarPath = `/store/order/${this.configuration.encodeParam({name: "orderId", value: orderId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, @@ -350,12 +353,13 @@ export class StoreService { } let localVarPath = `/store/order`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: order, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, diff --git a/samples/client/petstore/typescript-angular-v19/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v19/builds/default/api/user.service.ts index 316ece2e354d..4f6c9a540152 100644 --- a/samples/client/petstore/typescript-angular-v19/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v19/builds/default/api/user.service.ts @@ -157,12 +157,13 @@ export class UserService { } let localVarPath = `/user`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: user, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, @@ -238,12 +239,13 @@ export class UserService { } let localVarPath = `/user/createWithArray`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: user, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, @@ -319,12 +321,13 @@ export class UserService { } let localVarPath = `/user/createWithList`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: user, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, @@ -391,11 +394,12 @@ export class UserService { } let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - return this.httpClient.request('delete', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('delete', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, @@ -457,11 +461,12 @@ export class UserService { } let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, @@ -537,12 +542,13 @@ export class UserService { } let localVarPath = `/user/login`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, params: localVarQueryParameters, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, @@ -605,11 +611,12 @@ export class UserService { } let localVarPath = `/user/logout`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, @@ -689,12 +696,13 @@ export class UserService { } let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - return this.httpClient.request('put', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('put', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: user, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, diff --git a/samples/client/petstore/typescript-angular-v19/builds/default/configuration.ts b/samples/client/petstore/typescript-angular-v19/builds/default/configuration.ts index 4ad26d0bdcb9..f2021d99fa55 100644 --- a/samples/client/petstore/typescript-angular-v19/builds/default/configuration.ts +++ b/samples/client/petstore/typescript-angular-v19/builds/default/configuration.ts @@ -66,26 +66,30 @@ export class Configuration { */ credentials: {[ key: string ]: string | (() => string | undefined)}; - constructor(configurationParameters: ConfigurationParameters = {}) { - this.apiKeys = configurationParameters.apiKeys; - this.username = configurationParameters.username; - this.password = configurationParameters.password; - this.accessToken = configurationParameters.accessToken; - this.basePath = configurationParameters.basePath; - this.withCredentials = configurationParameters.withCredentials; - this.encoder = configurationParameters.encoder; - if (configurationParameters.encodeParam) { - this.encodeParam = configurationParameters.encodeParam; +constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, password, username, withCredentials }: ConfigurationParameters = {}) { + if (apiKeys) { + this.apiKeys = apiKeys; } - else { - this.encodeParam = param => this.defaultEncodeParam(param); + if (username) { + this.username = username; } - if (configurationParameters.credentials) { - this.credentials = configurationParameters.credentials; + if (password) { + this.password = password; } - else { - this.credentials = {}; + if (accessToken) { + this.accessToken = accessToken; } + if (basePath) { + this.basePath = basePath; + } + if (withCredentials) { + this.withCredentials = withCredentials; + } + if (encoder) { + this.encoder = encoder; + } + this.encodeParam = encodeParam ?? (param => this.defaultEncodeParam(param)); + this.credentials = credentials ?? {}; // init default petstore_auth credential if (!this.credentials['petstore_auth']) { diff --git a/samples/client/petstore/typescript-angular-v19/builds/default/tsconfig.json b/samples/client/petstore/typescript-angular-v19/builds/default/tsconfig.json index 85f130ae01ef..b3049e9eee69 100644 --- a/samples/client/petstore/typescript-angular-v19/builds/default/tsconfig.json +++ b/samples/client/petstore/typescript-angular-v19/builds/default/tsconfig.json @@ -7,6 +7,8 @@ "module": "es6", "moduleResolution": "node", "removeComments": true, + "strictNullChecks": true, + "exactOptionalPropertyTypes": true, "sourceMap": true, "outDir": "./dist", "noLib": false, From dacf2399ac23e54caa63c144acfcecf7bfc5c949 Mon Sep 17 00:00:00 2001 From: jase88 <804836+jase88@users.noreply.github.com> Date: Mon, 7 Apr 2025 21:33:03 +0200 Subject: [PATCH 2/3] fix(typescript-angular): update condition checks to explicitly compare with undefined --- .../typescript-angular/configuration.mustache | 10 +++++----- .../composed-schemas-tagged-unions/configuration.ts | 10 +++++----- .../builds/composed-schemas/configuration.ts | 10 +++++----- .../builds/default/configuration.ts | 10 +++++----- .../builds/default/configuration.ts | 10 +++++----- .../builds/default/configuration.ts | 10 +++++----- .../builds/with-npm/configuration.ts | 10 +++++----- .../builds/default/configuration.ts | 10 +++++----- .../builds/default/configuration.ts | 10 +++++----- .../builds/default/configuration.ts | 10 +++++----- .../builds/with-npm/configuration.ts | 10 +++++----- .../builds/default/configuration.ts | 10 +++++----- .../configuration.ts | 10 +++++----- .../builds/default/configuration.ts | 10 +++++----- .../builds/default/configuration.ts | 10 +++++----- .../builds/default/configuration.ts | 10 +++++----- .../builds/default/configuration.ts | 10 +++++----- .../builds/default/configuration.ts | 10 +++++----- .../builds/default/configuration.ts | 10 +++++----- 19 files changed, 95 insertions(+), 95 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/typescript-angular/configuration.mustache b/modules/openapi-generator/src/main/resources/typescript-angular/configuration.mustache index 84c79faa5eb2..3182d6027e33 100644 --- a/modules/openapi-generator/src/main/resources/typescript-angular/configuration.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-angular/configuration.mustache @@ -70,19 +70,19 @@ constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, if (apiKeys) { this.apiKeys = apiKeys; } - if (username) { + if (username !== undefined) { this.username = username; } - if (password) { + if (password !== undefined) { this.password = password; } - if (accessToken) { + if (accessToken !== undefined) { this.accessToken = accessToken; } - if (basePath) { + if (basePath !== undefined) { this.basePath = basePath; } - if (withCredentials) { + if (withCredentials !== undefined) { this.withCredentials = withCredentials; } if (encoder) { diff --git a/samples/client/others/typescript-angular/builds/composed-schemas-tagged-unions/configuration.ts b/samples/client/others/typescript-angular/builds/composed-schemas-tagged-unions/configuration.ts index 309648f4990f..2a128451c081 100644 --- a/samples/client/others/typescript-angular/builds/composed-schemas-tagged-unions/configuration.ts +++ b/samples/client/others/typescript-angular/builds/composed-schemas-tagged-unions/configuration.ts @@ -70,19 +70,19 @@ constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, if (apiKeys) { this.apiKeys = apiKeys; } - if (username) { + if (username !== undefined) { this.username = username; } - if (password) { + if (password !== undefined) { this.password = password; } - if (accessToken) { + if (accessToken !== undefined) { this.accessToken = accessToken; } - if (basePath) { + if (basePath !== undefined) { this.basePath = basePath; } - if (withCredentials) { + if (withCredentials !== undefined) { this.withCredentials = withCredentials; } if (encoder) { diff --git a/samples/client/others/typescript-angular/builds/composed-schemas/configuration.ts b/samples/client/others/typescript-angular/builds/composed-schemas/configuration.ts index 309648f4990f..2a128451c081 100644 --- a/samples/client/others/typescript-angular/builds/composed-schemas/configuration.ts +++ b/samples/client/others/typescript-angular/builds/composed-schemas/configuration.ts @@ -70,19 +70,19 @@ constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, if (apiKeys) { this.apiKeys = apiKeys; } - if (username) { + if (username !== undefined) { this.username = username; } - if (password) { + if (password !== undefined) { this.password = password; } - if (accessToken) { + if (accessToken !== undefined) { this.accessToken = accessToken; } - if (basePath) { + if (basePath !== undefined) { this.basePath = basePath; } - if (withCredentials) { + if (withCredentials !== undefined) { this.withCredentials = withCredentials; } if (encoder) { diff --git a/samples/client/petstore/typescript-angular-v12-oneOf/builds/default/configuration.ts b/samples/client/petstore/typescript-angular-v12-oneOf/builds/default/configuration.ts index 309648f4990f..2a128451c081 100644 --- a/samples/client/petstore/typescript-angular-v12-oneOf/builds/default/configuration.ts +++ b/samples/client/petstore/typescript-angular-v12-oneOf/builds/default/configuration.ts @@ -70,19 +70,19 @@ constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, if (apiKeys) { this.apiKeys = apiKeys; } - if (username) { + if (username !== undefined) { this.username = username; } - if (password) { + if (password !== undefined) { this.password = password; } - if (accessToken) { + if (accessToken !== undefined) { this.accessToken = accessToken; } - if (basePath) { + if (basePath !== undefined) { this.basePath = basePath; } - if (withCredentials) { + if (withCredentials !== undefined) { this.withCredentials = withCredentials; } if (encoder) { diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-any/builds/default/configuration.ts b/samples/client/petstore/typescript-angular-v12-provided-in-any/builds/default/configuration.ts index 6a2ee2a05675..775b99892d50 100644 --- a/samples/client/petstore/typescript-angular-v12-provided-in-any/builds/default/configuration.ts +++ b/samples/client/petstore/typescript-angular-v12-provided-in-any/builds/default/configuration.ts @@ -70,19 +70,19 @@ constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, if (apiKeys) { this.apiKeys = apiKeys; } - if (username) { + if (username !== undefined) { this.username = username; } - if (password) { + if (password !== undefined) { this.password = password; } - if (accessToken) { + if (accessToken !== undefined) { this.accessToken = accessToken; } - if (basePath) { + if (basePath !== undefined) { this.basePath = basePath; } - if (withCredentials) { + if (withCredentials !== undefined) { this.withCredentials = withCredentials; } if (encoder) { diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/configuration.ts b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/configuration.ts index 6a2ee2a05675..775b99892d50 100644 --- a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/configuration.ts +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/configuration.ts @@ -70,19 +70,19 @@ constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, if (apiKeys) { this.apiKeys = apiKeys; } - if (username) { + if (username !== undefined) { this.username = username; } - if (password) { + if (password !== undefined) { this.password = password; } - if (accessToken) { + if (accessToken !== undefined) { this.accessToken = accessToken; } - if (basePath) { + if (basePath !== undefined) { this.basePath = basePath; } - if (withCredentials) { + if (withCredentials !== undefined) { this.withCredentials = withCredentials; } if (encoder) { diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/configuration.ts b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/configuration.ts index 6a2ee2a05675..775b99892d50 100644 --- a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/configuration.ts +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/configuration.ts @@ -70,19 +70,19 @@ constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, if (apiKeys) { this.apiKeys = apiKeys; } - if (username) { + if (username !== undefined) { this.username = username; } - if (password) { + if (password !== undefined) { this.password = password; } - if (accessToken) { + if (accessToken !== undefined) { this.accessToken = accessToken; } - if (basePath) { + if (basePath !== undefined) { this.basePath = basePath; } - if (withCredentials) { + if (withCredentials !== undefined) { this.withCredentials = withCredentials; } if (encoder) { diff --git a/samples/client/petstore/typescript-angular-v13-oneOf/builds/default/configuration.ts b/samples/client/petstore/typescript-angular-v13-oneOf/builds/default/configuration.ts index 309648f4990f..2a128451c081 100644 --- a/samples/client/petstore/typescript-angular-v13-oneOf/builds/default/configuration.ts +++ b/samples/client/petstore/typescript-angular-v13-oneOf/builds/default/configuration.ts @@ -70,19 +70,19 @@ constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, if (apiKeys) { this.apiKeys = apiKeys; } - if (username) { + if (username !== undefined) { this.username = username; } - if (password) { + if (password !== undefined) { this.password = password; } - if (accessToken) { + if (accessToken !== undefined) { this.accessToken = accessToken; } - if (basePath) { + if (basePath !== undefined) { this.basePath = basePath; } - if (withCredentials) { + if (withCredentials !== undefined) { this.withCredentials = withCredentials; } if (encoder) { diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-any/builds/default/configuration.ts b/samples/client/petstore/typescript-angular-v13-provided-in-any/builds/default/configuration.ts index 6a2ee2a05675..775b99892d50 100644 --- a/samples/client/petstore/typescript-angular-v13-provided-in-any/builds/default/configuration.ts +++ b/samples/client/petstore/typescript-angular-v13-provided-in-any/builds/default/configuration.ts @@ -70,19 +70,19 @@ constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, if (apiKeys) { this.apiKeys = apiKeys; } - if (username) { + if (username !== undefined) { this.username = username; } - if (password) { + if (password !== undefined) { this.password = password; } - if (accessToken) { + if (accessToken !== undefined) { this.accessToken = accessToken; } - if (basePath) { + if (basePath !== undefined) { this.basePath = basePath; } - if (withCredentials) { + if (withCredentials !== undefined) { this.withCredentials = withCredentials; } if (encoder) { diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/configuration.ts b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/configuration.ts index 6a2ee2a05675..775b99892d50 100644 --- a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/configuration.ts +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/configuration.ts @@ -70,19 +70,19 @@ constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, if (apiKeys) { this.apiKeys = apiKeys; } - if (username) { + if (username !== undefined) { this.username = username; } - if (password) { + if (password !== undefined) { this.password = password; } - if (accessToken) { + if (accessToken !== undefined) { this.accessToken = accessToken; } - if (basePath) { + if (basePath !== undefined) { this.basePath = basePath; } - if (withCredentials) { + if (withCredentials !== undefined) { this.withCredentials = withCredentials; } if (encoder) { diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/configuration.ts b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/configuration.ts index 6a2ee2a05675..775b99892d50 100644 --- a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/configuration.ts +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/configuration.ts @@ -70,19 +70,19 @@ constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, if (apiKeys) { this.apiKeys = apiKeys; } - if (username) { + if (username !== undefined) { this.username = username; } - if (password) { + if (password !== undefined) { this.password = password; } - if (accessToken) { + if (accessToken !== undefined) { this.accessToken = accessToken; } - if (basePath) { + if (basePath !== undefined) { this.basePath = basePath; } - if (withCredentials) { + if (withCredentials !== undefined) { this.withCredentials = withCredentials; } if (encoder) { diff --git a/samples/client/petstore/typescript-angular-v14-provided-in-root/builds/default/configuration.ts b/samples/client/petstore/typescript-angular-v14-provided-in-root/builds/default/configuration.ts index 6a2ee2a05675..775b99892d50 100644 --- a/samples/client/petstore/typescript-angular-v14-provided-in-root/builds/default/configuration.ts +++ b/samples/client/petstore/typescript-angular-v14-provided-in-root/builds/default/configuration.ts @@ -70,19 +70,19 @@ constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, if (apiKeys) { this.apiKeys = apiKeys; } - if (username) { + if (username !== undefined) { this.username = username; } - if (password) { + if (password !== undefined) { this.password = password; } - if (accessToken) { + if (accessToken !== undefined) { this.accessToken = accessToken; } - if (basePath) { + if (basePath !== undefined) { this.basePath = basePath; } - if (withCredentials) { + if (withCredentials !== undefined) { this.withCredentials = withCredentials; } if (encoder) { diff --git a/samples/client/petstore/typescript-angular-v14-query-param-object-format/configuration.ts b/samples/client/petstore/typescript-angular-v14-query-param-object-format/configuration.ts index 6a2ee2a05675..775b99892d50 100644 --- a/samples/client/petstore/typescript-angular-v14-query-param-object-format/configuration.ts +++ b/samples/client/petstore/typescript-angular-v14-query-param-object-format/configuration.ts @@ -70,19 +70,19 @@ constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, if (apiKeys) { this.apiKeys = apiKeys; } - if (username) { + if (username !== undefined) { this.username = username; } - if (password) { + if (password !== undefined) { this.password = password; } - if (accessToken) { + if (accessToken !== undefined) { this.accessToken = accessToken; } - if (basePath) { + if (basePath !== undefined) { this.basePath = basePath; } - if (withCredentials) { + if (withCredentials !== undefined) { this.withCredentials = withCredentials; } if (encoder) { diff --git a/samples/client/petstore/typescript-angular-v15-provided-in-root/builds/default/configuration.ts b/samples/client/petstore/typescript-angular-v15-provided-in-root/builds/default/configuration.ts index 6a2ee2a05675..775b99892d50 100644 --- a/samples/client/petstore/typescript-angular-v15-provided-in-root/builds/default/configuration.ts +++ b/samples/client/petstore/typescript-angular-v15-provided-in-root/builds/default/configuration.ts @@ -70,19 +70,19 @@ constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, if (apiKeys) { this.apiKeys = apiKeys; } - if (username) { + if (username !== undefined) { this.username = username; } - if (password) { + if (password !== undefined) { this.password = password; } - if (accessToken) { + if (accessToken !== undefined) { this.accessToken = accessToken; } - if (basePath) { + if (basePath !== undefined) { this.basePath = basePath; } - if (withCredentials) { + if (withCredentials !== undefined) { this.withCredentials = withCredentials; } if (encoder) { diff --git a/samples/client/petstore/typescript-angular-v16-provided-in-root/builds/default/configuration.ts b/samples/client/petstore/typescript-angular-v16-provided-in-root/builds/default/configuration.ts index 6a2ee2a05675..775b99892d50 100644 --- a/samples/client/petstore/typescript-angular-v16-provided-in-root/builds/default/configuration.ts +++ b/samples/client/petstore/typescript-angular-v16-provided-in-root/builds/default/configuration.ts @@ -70,19 +70,19 @@ constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, if (apiKeys) { this.apiKeys = apiKeys; } - if (username) { + if (username !== undefined) { this.username = username; } - if (password) { + if (password !== undefined) { this.password = password; } - if (accessToken) { + if (accessToken !== undefined) { this.accessToken = accessToken; } - if (basePath) { + if (basePath !== undefined) { this.basePath = basePath; } - if (withCredentials) { + if (withCredentials !== undefined) { this.withCredentials = withCredentials; } if (encoder) { diff --git a/samples/client/petstore/typescript-angular-v17-provided-in-root/builds/default/configuration.ts b/samples/client/petstore/typescript-angular-v17-provided-in-root/builds/default/configuration.ts index 6a2ee2a05675..775b99892d50 100644 --- a/samples/client/petstore/typescript-angular-v17-provided-in-root/builds/default/configuration.ts +++ b/samples/client/petstore/typescript-angular-v17-provided-in-root/builds/default/configuration.ts @@ -70,19 +70,19 @@ constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, if (apiKeys) { this.apiKeys = apiKeys; } - if (username) { + if (username !== undefined) { this.username = username; } - if (password) { + if (password !== undefined) { this.password = password; } - if (accessToken) { + if (accessToken !== undefined) { this.accessToken = accessToken; } - if (basePath) { + if (basePath !== undefined) { this.basePath = basePath; } - if (withCredentials) { + if (withCredentials !== undefined) { this.withCredentials = withCredentials; } if (encoder) { diff --git a/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/configuration.ts b/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/configuration.ts index 6a2ee2a05675..775b99892d50 100644 --- a/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/configuration.ts +++ b/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/configuration.ts @@ -70,19 +70,19 @@ constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, if (apiKeys) { this.apiKeys = apiKeys; } - if (username) { + if (username !== undefined) { this.username = username; } - if (password) { + if (password !== undefined) { this.password = password; } - if (accessToken) { + if (accessToken !== undefined) { this.accessToken = accessToken; } - if (basePath) { + if (basePath !== undefined) { this.basePath = basePath; } - if (withCredentials) { + if (withCredentials !== undefined) { this.withCredentials = withCredentials; } if (encoder) { diff --git a/samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/configuration.ts b/samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/configuration.ts index 6a2ee2a05675..775b99892d50 100644 --- a/samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/configuration.ts +++ b/samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/configuration.ts @@ -70,19 +70,19 @@ constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, if (apiKeys) { this.apiKeys = apiKeys; } - if (username) { + if (username !== undefined) { this.username = username; } - if (password) { + if (password !== undefined) { this.password = password; } - if (accessToken) { + if (accessToken !== undefined) { this.accessToken = accessToken; } - if (basePath) { + if (basePath !== undefined) { this.basePath = basePath; } - if (withCredentials) { + if (withCredentials !== undefined) { this.withCredentials = withCredentials; } if (encoder) { diff --git a/samples/client/petstore/typescript-angular-v19/builds/default/configuration.ts b/samples/client/petstore/typescript-angular-v19/builds/default/configuration.ts index 6a2ee2a05675..775b99892d50 100644 --- a/samples/client/petstore/typescript-angular-v19/builds/default/configuration.ts +++ b/samples/client/petstore/typescript-angular-v19/builds/default/configuration.ts @@ -70,19 +70,19 @@ constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, if (apiKeys) { this.apiKeys = apiKeys; } - if (username) { + if (username !== undefined) { this.username = username; } - if (password) { + if (password !== undefined) { this.password = password; } - if (accessToken) { + if (accessToken !== undefined) { this.accessToken = accessToken; } - if (basePath) { + if (basePath !== undefined) { this.basePath = basePath; } - if (withCredentials) { + if (withCredentials !== undefined) { this.withCredentials = withCredentials; } if (encoder) { From 6f7b9b0156cbe1993d29d79eda5e1b1a9113c3d7 Mon Sep 17 00:00:00 2001 From: jase88 <804836+jase88@users.noreply.github.com> Date: Wed, 23 Apr 2025 11:21:30 +0200 Subject: [PATCH 3/3] chore(gradle): add autogenerated properties file for OpenAPI Generator --- samples/client/echo_api/java/native/gradle.properties | 6 ++++++ samples/client/petstore/java/native-async/gradle.properties | 6 ++++++ .../client/petstore/java/native-jakarta/gradle.properties | 6 ++++++ samples/client/petstore/java/native/gradle.properties | 6 ++++++ 4 files changed, 24 insertions(+) diff --git a/samples/client/echo_api/java/native/gradle.properties b/samples/client/echo_api/java/native/gradle.properties index e69de29bb2d1..a3408578278a 100644 --- a/samples/client/echo_api/java/native/gradle.properties +++ b/samples/client/echo_api/java/native/gradle.properties @@ -0,0 +1,6 @@ +# This file is automatically generated by OpenAPI Generator (https://github.com/openAPITools/openapi-generator). +# To include other gradle properties as part of the code generation process, please use the `gradleProperties` option. +# +# Gradle properties reference: https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties +# For example, uncomment below to build for Android +#target = android diff --git a/samples/client/petstore/java/native-async/gradle.properties b/samples/client/petstore/java/native-async/gradle.properties index e69de29bb2d1..a3408578278a 100644 --- a/samples/client/petstore/java/native-async/gradle.properties +++ b/samples/client/petstore/java/native-async/gradle.properties @@ -0,0 +1,6 @@ +# This file is automatically generated by OpenAPI Generator (https://github.com/openAPITools/openapi-generator). +# To include other gradle properties as part of the code generation process, please use the `gradleProperties` option. +# +# Gradle properties reference: https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties +# For example, uncomment below to build for Android +#target = android diff --git a/samples/client/petstore/java/native-jakarta/gradle.properties b/samples/client/petstore/java/native-jakarta/gradle.properties index e69de29bb2d1..a3408578278a 100644 --- a/samples/client/petstore/java/native-jakarta/gradle.properties +++ b/samples/client/petstore/java/native-jakarta/gradle.properties @@ -0,0 +1,6 @@ +# This file is automatically generated by OpenAPI Generator (https://github.com/openAPITools/openapi-generator). +# To include other gradle properties as part of the code generation process, please use the `gradleProperties` option. +# +# Gradle properties reference: https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties +# For example, uncomment below to build for Android +#target = android diff --git a/samples/client/petstore/java/native/gradle.properties b/samples/client/petstore/java/native/gradle.properties index e69de29bb2d1..a3408578278a 100644 --- a/samples/client/petstore/java/native/gradle.properties +++ b/samples/client/petstore/java/native/gradle.properties @@ -0,0 +1,6 @@ +# This file is automatically generated by OpenAPI Generator (https://github.com/openAPITools/openapi-generator). +# To include other gradle properties as part of the code generation process, please use the `gradleProperties` option. +# +# Gradle properties reference: https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties +# For example, uncomment below to build for Android +#target = android