mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-05-12 12:40:53 +00:00
Merge 7ad2de8422a44718a9cf0c4d924e54ffc6ddc4df into d6c46342693205f0dae441b45742d9c85d41cf33
This commit is contained in:
commit
8f994b3efc
@ -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}}
|
||||
|
@ -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[] = [
|
||||
|
Loading…
x
Reference in New Issue
Block a user