Merge 7ad2de8422a44718a9cf0c4d924e54ffc6ddc4df into d6c46342693205f0dae441b45742d9c85d41cf33

This commit is contained in:
Jonathan 2025-05-10 07:09:48 +02:00 committed by GitHub
commit 8f994b3efc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 54 additions and 9 deletions

View File

@ -208,7 +208,12 @@ export class {{classname}} extends runtime.BaseAPI {
{{#isOAuth}}
if (this.configuration && this.configuration.accessToken) {
// oauth required
headerParameters["Authorization"] = await this.configuration.accessToken("{{name}}", [{{#scopes}}"{{{scope}}}"{{^-last}}, {{/-last}}{{/scopes}}]);
const token = this.configuration.accessToken;
const tokenString = await token("{{name}}", [{{#scopes}}"{{{scope}}}"{{^-last}}, {{/-last}}{{/scopes}}]);
if (tokenString) {
headerParameters["Authorization"] = `Bearer ${tokenString}`;
}
}
{{/isOAuth}}

View File

@ -93,7 +93,12 @@ export class PetApi extends runtime.BaseAPI {
if (this.configuration && this.configuration.accessToken) {
// oauth required
headerParameters["Authorization"] = await this.configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]);
const token = this.configuration.accessToken;
const tokenString = await token("petstore_auth", ["write:pets", "read:pets"]);
if (tokenString) {
headerParameters["Authorization"] = `Bearer ${tokenString}`;
}
}
const response = await this.request({
@ -137,7 +142,12 @@ export class PetApi extends runtime.BaseAPI {
if (this.configuration && this.configuration.accessToken) {
// oauth required
headerParameters["Authorization"] = await this.configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]);
const token = this.configuration.accessToken;
const tokenString = await token("petstore_auth", ["write:pets", "read:pets"]);
if (tokenString) {
headerParameters["Authorization"] = `Bearer ${tokenString}`;
}
}
const response = await this.request({
@ -180,7 +190,12 @@ export class PetApi extends runtime.BaseAPI {
if (this.configuration && this.configuration.accessToken) {
// oauth required
headerParameters["Authorization"] = await this.configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]);
const token = this.configuration.accessToken;
const tokenString = await token("petstore_auth", ["write:pets", "read:pets"]);
if (tokenString) {
headerParameters["Authorization"] = `Bearer ${tokenString}`;
}
}
const response = await this.request({
@ -225,7 +240,12 @@ export class PetApi extends runtime.BaseAPI {
if (this.configuration && this.configuration.accessToken) {
// oauth required
headerParameters["Authorization"] = await this.configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]);
const token = this.configuration.accessToken;
const tokenString = await token("petstore_auth", ["write:pets", "read:pets"]);
if (tokenString) {
headerParameters["Authorization"] = `Bearer ${tokenString}`;
}
}
const response = await this.request({
@ -307,7 +327,12 @@ export class PetApi extends runtime.BaseAPI {
if (this.configuration && this.configuration.accessToken) {
// oauth required
headerParameters["Authorization"] = await this.configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]);
const token = this.configuration.accessToken;
const tokenString = await token("petstore_auth", ["write:pets", "read:pets"]);
if (tokenString) {
headerParameters["Authorization"] = `Bearer ${tokenString}`;
}
}
const response = await this.request({
@ -347,7 +372,12 @@ export class PetApi extends runtime.BaseAPI {
if (this.configuration && this.configuration.accessToken) {
// oauth required
headerParameters["Authorization"] = await this.configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]);
const token = this.configuration.accessToken;
const tokenString = await token("petstore_auth", ["write:pets", "read:pets"]);
if (tokenString) {
headerParameters["Authorization"] = `Bearer ${tokenString}`;
}
}
const consumes: runtime.Consume[] = [
@ -409,7 +439,12 @@ export class PetApi extends runtime.BaseAPI {
if (this.configuration && this.configuration.accessToken) {
// oauth required
headerParameters["Authorization"] = await this.configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]);
const token = this.configuration.accessToken;
const tokenString = await token("petstore_auth", ["write:pets", "read:pets"]);
if (tokenString) {
headerParameters["Authorization"] = `Bearer ${tokenString}`;
}
}
const consumes: runtime.Consume[] = [
@ -481,7 +516,12 @@ export class PetApi extends runtime.BaseAPI {
if (this.configuration && this.configuration.accessToken) {
// oauth required
headerParameters["Authorization"] = await this.configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]);
const token = this.configuration.accessToken;
const tokenString = await token("petstore_auth", ["write:pets", "read:pets"]);
if (tokenString) {
headerParameters["Authorization"] = `Bearer ${tokenString}`;
}
}
const consumes: runtime.Consume[] = [