regenerates api client with changes for query (#30070)

This commit is contained in:
Jordan Reimer 2025-03-28 13:26:04 -06:00 committed by GitHub
parent 513671b72c
commit 1cb6eacaca
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 19 additions and 18 deletions

View File

@ -162,12 +162,6 @@ export class BaseAPI {
createFetchParams(context, initOverrides) { createFetchParams(context, initOverrides) {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
let url = this.configuration.basePath + context.path; let url = this.configuration.basePath + context.path;
if (context.query !== undefined && Object.keys(context.query).length !== 0) {
// only add the querystring to the URL if there are query parameters.
// this is done to avoid urls ending with a "?" character which buggy webservers
// do not handle correctly sometimes.
url += '?' + this.configuration.queryParamsStringify(context.query);
}
const headers = Object.assign({}, this.configuration.headers, context.headers); const headers = Object.assign({}, this.configuration.headers, context.headers);
Object.keys(headers).forEach(key => headers[key] === undefined ? delete headers[key] : {}); Object.keys(headers).forEach(key => headers[key] === undefined ? delete headers[key] : {});
const initOverrideFn = typeof initOverrides === "function" const initOverrideFn = typeof initOverrides === "function"
@ -183,6 +177,12 @@ export class BaseAPI {
init: initParams, init: initParams,
context, context,
}))); })));
if (context.query !== undefined && Object.keys(context.query).length !== 0) {
// only add the querystring to the URL if there are query parameters.
// this is done to avoid urls ending with a "?" character which buggy webservers
// do not handle correctly sometimes.
url += '?' + this.configuration.queryParamsStringify(context.query);
}
let body; let body;
if (isFormData(overriddenInit.body) if (isFormData(overriddenInit.body)
|| (overriddenInit.body instanceof URLSearchParams) || (overriddenInit.body instanceof URLSearchParams)

View File

@ -170,12 +170,6 @@ class BaseAPI {
createFetchParams(context, initOverrides) { createFetchParams(context, initOverrides) {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
let url = this.configuration.basePath + context.path; let url = this.configuration.basePath + context.path;
if (context.query !== undefined && Object.keys(context.query).length !== 0) {
// only add the querystring to the URL if there are query parameters.
// this is done to avoid urls ending with a "?" character which buggy webservers
// do not handle correctly sometimes.
url += '?' + this.configuration.queryParamsStringify(context.query);
}
const headers = Object.assign({}, this.configuration.headers, context.headers); const headers = Object.assign({}, this.configuration.headers, context.headers);
Object.keys(headers).forEach(key => headers[key] === undefined ? delete headers[key] : {}); Object.keys(headers).forEach(key => headers[key] === undefined ? delete headers[key] : {});
const initOverrideFn = typeof initOverrides === "function" const initOverrideFn = typeof initOverrides === "function"
@ -191,6 +185,12 @@ class BaseAPI {
init: initParams, init: initParams,
context, context,
}))); })));
if (context.query !== undefined && Object.keys(context.query).length !== 0) {
// only add the querystring to the URL if there are query parameters.
// this is done to avoid urls ending with a "?" character which buggy webservers
// do not handle correctly sometimes.
url += '?' + this.configuration.queryParamsStringify(context.query);
}
let body; let body;
if (isFormData(overriddenInit.body) if (isFormData(overriddenInit.body)
|| (overriddenInit.body instanceof URLSearchParams) || (overriddenInit.body instanceof URLSearchParams)

View File

@ -143,12 +143,6 @@ export class BaseAPI {
private async createFetchParams(context: RequestOpts, initOverrides?: RequestInit | InitOverrideFunction) { private async createFetchParams(context: RequestOpts, initOverrides?: RequestInit | InitOverrideFunction) {
let url = this.configuration.basePath + context.path; let url = this.configuration.basePath + context.path;
if (context.query !== undefined && Object.keys(context.query).length !== 0) {
// only add the querystring to the URL if there are query parameters.
// this is done to avoid urls ending with a "?" character which buggy webservers
// do not handle correctly sometimes.
url += '?' + this.configuration.queryParamsStringify(context.query);
}
const headers = Object.assign({}, this.configuration.headers, context.headers); const headers = Object.assign({}, this.configuration.headers, context.headers);
Object.keys(headers).forEach(key => headers[key] === undefined ? delete headers[key] : {}); Object.keys(headers).forEach(key => headers[key] === undefined ? delete headers[key] : {});
@ -173,6 +167,13 @@ export class BaseAPI {
})) }))
}; };
if (context.query !== undefined && Object.keys(context.query).length !== 0) {
// only add the querystring to the URL if there are query parameters.
// this is done to avoid urls ending with a "?" character which buggy webservers
// do not handle correctly sometimes.
url += '?' + this.configuration.queryParamsStringify(context.query);
}
let body: any; let body: any;
if (isFormData(overriddenInit.body) if (isFormData(overriddenInit.body)
|| (overriddenInit.body instanceof URLSearchParams) || (overriddenInit.body instanceof URLSearchParams)