diff --git a/modules/openapi-generator/src/main/resources/cpp-qt-client/api-body.mustache b/modules/openapi-generator/src/main/resources/cpp-qt-client/api-body.mustache index 38172b270edb..0a88f9f7eae7 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt-client/api-body.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt-client/api-body.mustache @@ -702,13 +702,13 @@ void {{classname}}::{{nickname}}({{#allParams}}{{#required}}const {{{dataType}}} _credentialFlow.unlink(); _passwordFlow.unlink(); _authFlow.link(); - QStringList scope; + QStringList scope2; {{#scopes}} - scope.append("{{scope}}"); + scope2.append("{{scope}}"); {{/scopes}} - auto token = _authFlow.getToken(scope.join(" ")); - if(token.isValid()) - input.headers.insert("Authorization", "Bearer " + token.getToken()); + auto token2 = _authFlow.getToken(scope2.join(" ")); + if(token2.isValid()) + input.headers.insert("Authorization", "Bearer " + token2.getToken()); _latestWorker = new {{prefix}}HttpRequestWorker(this, _manager); _latestWorker->setTimeOut(_timeOut); @@ -725,20 +725,20 @@ void {{classname}}::{{nickname}}({{#allParams}}{{#required}}const {{{dataType}}} }); _latestInput = input; - _latestScope = scope;{{/isCode}} + _latestScope = scope2;{{/isCode}} {{#isImplicit}} _OauthMethod = 1; _implicitFlow.link(); _passwordFlow.unlink(); _authFlow.unlink(); _credentialFlow.unlink(); - QStringList scope; + QStringList scope1; {{#scopes}} - scope.append("{{scope}}"); + scope1.append("{{scope}}"); {{/scopes}} - auto token = _implicitFlow.getToken(scope.join(" ")); - if(token.isValid()) - input.headers.insert("Authorization", "Bearer " + token.getToken()); + auto token1 = _implicitFlow.getToken(scope1.join(" ")); + if(token1.isValid()) + input.headers.insert("Authorization", "Bearer " + token1.getToken()); _latestWorker = new {{prefix}}HttpRequestWorker(this, _manager); _latestWorker->setTimeOut(_timeOut); @@ -755,20 +755,20 @@ void {{classname}}::{{nickname}}({{#allParams}}{{#required}}const {{{dataType}}} }); _latestInput = input; - _latestScope = scope;{{/isImplicit}} + _latestScope = scope1;{{/isImplicit}} {{#isApplication}} _OauthMethod = 3; _authFlow.unlink(); _implicitFlow.unlink(); _passwordFlow.unlink(); _credentialFlow.link(); - QStringList scope; + QStringList scope3; {{#scopes}} - scope.append("{{scope}}"); + scope3.append("{{scope}}"); {{/scopes}} - auto token = _credentialFlow.getToken(scope.join(" ")); - if(token.isValid()) - input.headers.insert("Authorization", "Bearer " + token.getToken()); + auto token3 = _credentialFlow.getToken(scope3.join(" ")); + if(token3.isValid()) + input.headers.insert("Authorization", "Bearer " + token3.getToken()); _latestWorker = new {{prefix}}HttpRequestWorker(this, _manager); _latestWorker->setTimeOut(_timeOut); @@ -785,20 +785,20 @@ void {{classname}}::{{nickname}}({{#allParams}}{{#required}}const {{{dataType}}} }); _latestInput = input; - _latestScope = scope;{{/isApplication}} + _latestScope = scope3;{{/isApplication}} {{#isPassword}} _OauthMethod = 4; _passwordFlow.link(); _authFlow.unlink(); _implicitFlow.unlink(); _credentialFlow.unlink(); - QStringList scope; + QStringList scope4; {{#scopes}} - scope.append("{{scope}}"); + scope4.append("{{scope}}"); {{/scopes}} - auto token = _passwordFlow.getToken(scope.join(" ")); - if(token.isValid()) - input.headers.insert("Authorization", "Bearer " + token.getToken()); + auto token4 = _passwordFlow.getToken(scope4.join(" ")); + if(token4.isValid()) + input.headers.insert("Authorization", "Bearer " + token4.getToken()); _latestWorker = new {{prefix}}HttpRequestWorker(this, _manager); _latestWorker->setTimeOut(_timeOut); @@ -815,7 +815,7 @@ void {{classname}}::{{nickname}}({{#allParams}}{{#required}}const {{{dataType}}} }); _latestInput = input; - _latestScope = scope; + _latestScope = scope4; {{/isPassword}}{{/isOAuth}}{{/authMethods}} worker->execute(&input); diff --git a/samples/client/petstore/cpp-qt-addDownloadProgress/client/PFXPetApi.cpp b/samples/client/petstore/cpp-qt-addDownloadProgress/client/PFXPetApi.cpp index b414998f9c24..37c2a109fe64 100644 --- a/samples/client/petstore/cpp-qt-addDownloadProgress/client/PFXPetApi.cpp +++ b/samples/client/petstore/cpp-qt-addDownloadProgress/client/PFXPetApi.cpp @@ -269,12 +269,12 @@ void PFXPetApi::addPet(const PFXPet &pfx_pet) { _passwordFlow.unlink(); _authFlow.unlink(); _credentialFlow.unlink(); - QStringList scope; - scope.append("write:pets"); - scope.append("read:pets"); - auto token = _implicitFlow.getToken(scope.join(" ")); - if(token.isValid()) - input.headers.insert("Authorization", "Bearer " + token.getToken()); + QStringList scope1; + scope1.append("write:pets"); + scope1.append("read:pets"); + auto token1 = _implicitFlow.getToken(scope1.join(" ")); + if(token1.isValid()) + input.headers.insert("Authorization", "Bearer " + token1.getToken()); _latestWorker = new PFXHttpRequestWorker(this, _manager); _latestWorker->setTimeOut(_timeOut); @@ -289,7 +289,7 @@ void PFXPetApi::addPet(const PFXPet &pfx_pet) { }); _latestInput = input; - _latestScope = scope; + _latestScope = scope1; @@ -477,12 +477,12 @@ void PFXPetApi::deletePet(const qint64 &pet_id, const ::test_namespace::Optional _passwordFlow.unlink(); _authFlow.unlink(); _credentialFlow.unlink(); - QStringList scope; - scope.append("write:pets"); - scope.append("read:pets"); - auto token = _implicitFlow.getToken(scope.join(" ")); - if(token.isValid()) - input.headers.insert("Authorization", "Bearer " + token.getToken()); + QStringList scope1; + scope1.append("write:pets"); + scope1.append("read:pets"); + auto token1 = _implicitFlow.getToken(scope1.join(" ")); + if(token1.isValid()) + input.headers.insert("Authorization", "Bearer " + token1.getToken()); _latestWorker = new PFXHttpRequestWorker(this, _manager); _latestWorker->setTimeOut(_timeOut); @@ -497,7 +497,7 @@ void PFXPetApi::deletePet(const qint64 &pet_id, const ::test_namespace::Optional }); _latestInput = input; - _latestScope = scope; + _latestScope = scope1; @@ -672,12 +672,12 @@ void PFXPetApi::findPetsByStatus(const QList &status) { _passwordFlow.unlink(); _authFlow.unlink(); _credentialFlow.unlink(); - QStringList scope; - scope.append("write:pets"); - scope.append("read:pets"); - auto token = _implicitFlow.getToken(scope.join(" ")); - if(token.isValid()) - input.headers.insert("Authorization", "Bearer " + token.getToken()); + QStringList scope1; + scope1.append("write:pets"); + scope1.append("read:pets"); + auto token1 = _implicitFlow.getToken(scope1.join(" ")); + if(token1.isValid()) + input.headers.insert("Authorization", "Bearer " + token1.getToken()); _latestWorker = new PFXHttpRequestWorker(this, _manager); _latestWorker->setTimeOut(_timeOut); @@ -692,7 +692,7 @@ void PFXPetApi::findPetsByStatus(const QList &status) { }); _latestInput = input; - _latestScope = scope; + _latestScope = scope1; @@ -877,12 +877,12 @@ void PFXPetApi::findPetsByTags(const QList &tags) { _passwordFlow.unlink(); _authFlow.unlink(); _credentialFlow.unlink(); - QStringList scope; - scope.append("write:pets"); - scope.append("read:pets"); - auto token = _implicitFlow.getToken(scope.join(" ")); - if(token.isValid()) - input.headers.insert("Authorization", "Bearer " + token.getToken()); + QStringList scope1; + scope1.append("write:pets"); + scope1.append("read:pets"); + auto token1 = _implicitFlow.getToken(scope1.join(" ")); + if(token1.isValid()) + input.headers.insert("Authorization", "Bearer " + token1.getToken()); _latestWorker = new PFXHttpRequestWorker(this, _manager); _latestWorker->setTimeOut(_timeOut); @@ -897,7 +897,7 @@ void PFXPetApi::findPetsByTags(const QList &tags) { }); _latestInput = input; - _latestScope = scope; + _latestScope = scope1; @@ -1089,12 +1089,12 @@ void PFXPetApi::updatePet(const PFXPet &pfx_pet) { _passwordFlow.unlink(); _authFlow.unlink(); _credentialFlow.unlink(); - QStringList scope; - scope.append("write:pets"); - scope.append("read:pets"); - auto token = _implicitFlow.getToken(scope.join(" ")); - if(token.isValid()) - input.headers.insert("Authorization", "Bearer " + token.getToken()); + QStringList scope1; + scope1.append("write:pets"); + scope1.append("read:pets"); + auto token1 = _implicitFlow.getToken(scope1.join(" ")); + if(token1.isValid()) + input.headers.insert("Authorization", "Bearer " + token1.getToken()); _latestWorker = new PFXHttpRequestWorker(this, _manager); _latestWorker->setTimeOut(_timeOut); @@ -1109,7 +1109,7 @@ void PFXPetApi::updatePet(const PFXPet &pfx_pet) { }); _latestInput = input; - _latestScope = scope; + _latestScope = scope1; @@ -1220,12 +1220,12 @@ void PFXPetApi::updatePetWithForm(const qint64 &pet_id, const ::test_namespace:: _passwordFlow.unlink(); _authFlow.unlink(); _credentialFlow.unlink(); - QStringList scope; - scope.append("write:pets"); - scope.append("read:pets"); - auto token = _implicitFlow.getToken(scope.join(" ")); - if(token.isValid()) - input.headers.insert("Authorization", "Bearer " + token.getToken()); + QStringList scope1; + scope1.append("write:pets"); + scope1.append("read:pets"); + auto token1 = _implicitFlow.getToken(scope1.join(" ")); + if(token1.isValid()) + input.headers.insert("Authorization", "Bearer " + token1.getToken()); _latestWorker = new PFXHttpRequestWorker(this, _manager); _latestWorker->setTimeOut(_timeOut); @@ -1240,7 +1240,7 @@ void PFXPetApi::updatePetWithForm(const qint64 &pet_id, const ::test_namespace:: }); _latestInput = input; - _latestScope = scope; + _latestScope = scope1; @@ -1351,12 +1351,12 @@ void PFXPetApi::uploadFile(const qint64 &pet_id, const ::test_namespace::Optiona _passwordFlow.unlink(); _authFlow.unlink(); _credentialFlow.unlink(); - QStringList scope; - scope.append("write:pets"); - scope.append("read:pets"); - auto token = _implicitFlow.getToken(scope.join(" ")); - if(token.isValid()) - input.headers.insert("Authorization", "Bearer " + token.getToken()); + QStringList scope1; + scope1.append("write:pets"); + scope1.append("read:pets"); + auto token1 = _implicitFlow.getToken(scope1.join(" ")); + if(token1.isValid()) + input.headers.insert("Authorization", "Bearer " + token1.getToken()); _latestWorker = new PFXHttpRequestWorker(this, _manager); _latestWorker->setTimeOut(_timeOut); @@ -1371,7 +1371,7 @@ void PFXPetApi::uploadFile(const qint64 &pet_id, const ::test_namespace::Optiona }); _latestInput = input; - _latestScope = scope; + _latestScope = scope1; diff --git a/samples/client/petstore/cpp-qt/client/PFXPetApi.cpp b/samples/client/petstore/cpp-qt/client/PFXPetApi.cpp index cb07b0b4718b..13529d2d3b45 100644 --- a/samples/client/petstore/cpp-qt/client/PFXPetApi.cpp +++ b/samples/client/petstore/cpp-qt/client/PFXPetApi.cpp @@ -269,12 +269,12 @@ void PFXPetApi::addPet(const PFXPet &pfx_pet) { _passwordFlow.unlink(); _authFlow.unlink(); _credentialFlow.unlink(); - QStringList scope; - scope.append("write:pets"); - scope.append("read:pets"); - auto token = _implicitFlow.getToken(scope.join(" ")); - if(token.isValid()) - input.headers.insert("Authorization", "Bearer " + token.getToken()); + QStringList scope1; + scope1.append("write:pets"); + scope1.append("read:pets"); + auto token1 = _implicitFlow.getToken(scope1.join(" ")); + if(token1.isValid()) + input.headers.insert("Authorization", "Bearer " + token1.getToken()); _latestWorker = new PFXHttpRequestWorker(this, _manager); _latestWorker->setTimeOut(_timeOut); @@ -289,7 +289,7 @@ void PFXPetApi::addPet(const PFXPet &pfx_pet) { }); _latestInput = input; - _latestScope = scope; + _latestScope = scope1; @@ -477,12 +477,12 @@ void PFXPetApi::deletePet(const qint64 &pet_id, const ::test_namespace::Optional _passwordFlow.unlink(); _authFlow.unlink(); _credentialFlow.unlink(); - QStringList scope; - scope.append("write:pets"); - scope.append("read:pets"); - auto token = _implicitFlow.getToken(scope.join(" ")); - if(token.isValid()) - input.headers.insert("Authorization", "Bearer " + token.getToken()); + QStringList scope1; + scope1.append("write:pets"); + scope1.append("read:pets"); + auto token1 = _implicitFlow.getToken(scope1.join(" ")); + if(token1.isValid()) + input.headers.insert("Authorization", "Bearer " + token1.getToken()); _latestWorker = new PFXHttpRequestWorker(this, _manager); _latestWorker->setTimeOut(_timeOut); @@ -497,7 +497,7 @@ void PFXPetApi::deletePet(const qint64 &pet_id, const ::test_namespace::Optional }); _latestInput = input; - _latestScope = scope; + _latestScope = scope1; @@ -672,12 +672,12 @@ void PFXPetApi::findPetsByStatus(const QList &status) { _passwordFlow.unlink(); _authFlow.unlink(); _credentialFlow.unlink(); - QStringList scope; - scope.append("write:pets"); - scope.append("read:pets"); - auto token = _implicitFlow.getToken(scope.join(" ")); - if(token.isValid()) - input.headers.insert("Authorization", "Bearer " + token.getToken()); + QStringList scope1; + scope1.append("write:pets"); + scope1.append("read:pets"); + auto token1 = _implicitFlow.getToken(scope1.join(" ")); + if(token1.isValid()) + input.headers.insert("Authorization", "Bearer " + token1.getToken()); _latestWorker = new PFXHttpRequestWorker(this, _manager); _latestWorker->setTimeOut(_timeOut); @@ -692,7 +692,7 @@ void PFXPetApi::findPetsByStatus(const QList &status) { }); _latestInput = input; - _latestScope = scope; + _latestScope = scope1; @@ -877,12 +877,12 @@ void PFXPetApi::findPetsByTags(const QList &tags) { _passwordFlow.unlink(); _authFlow.unlink(); _credentialFlow.unlink(); - QStringList scope; - scope.append("write:pets"); - scope.append("read:pets"); - auto token = _implicitFlow.getToken(scope.join(" ")); - if(token.isValid()) - input.headers.insert("Authorization", "Bearer " + token.getToken()); + QStringList scope1; + scope1.append("write:pets"); + scope1.append("read:pets"); + auto token1 = _implicitFlow.getToken(scope1.join(" ")); + if(token1.isValid()) + input.headers.insert("Authorization", "Bearer " + token1.getToken()); _latestWorker = new PFXHttpRequestWorker(this, _manager); _latestWorker->setTimeOut(_timeOut); @@ -897,7 +897,7 @@ void PFXPetApi::findPetsByTags(const QList &tags) { }); _latestInput = input; - _latestScope = scope; + _latestScope = scope1; @@ -1089,12 +1089,12 @@ void PFXPetApi::updatePet(const PFXPet &pfx_pet) { _passwordFlow.unlink(); _authFlow.unlink(); _credentialFlow.unlink(); - QStringList scope; - scope.append("write:pets"); - scope.append("read:pets"); - auto token = _implicitFlow.getToken(scope.join(" ")); - if(token.isValid()) - input.headers.insert("Authorization", "Bearer " + token.getToken()); + QStringList scope1; + scope1.append("write:pets"); + scope1.append("read:pets"); + auto token1 = _implicitFlow.getToken(scope1.join(" ")); + if(token1.isValid()) + input.headers.insert("Authorization", "Bearer " + token1.getToken()); _latestWorker = new PFXHttpRequestWorker(this, _manager); _latestWorker->setTimeOut(_timeOut); @@ -1109,7 +1109,7 @@ void PFXPetApi::updatePet(const PFXPet &pfx_pet) { }); _latestInput = input; - _latestScope = scope; + _latestScope = scope1; @@ -1220,12 +1220,12 @@ void PFXPetApi::updatePetWithForm(const qint64 &pet_id, const ::test_namespace:: _passwordFlow.unlink(); _authFlow.unlink(); _credentialFlow.unlink(); - QStringList scope; - scope.append("write:pets"); - scope.append("read:pets"); - auto token = _implicitFlow.getToken(scope.join(" ")); - if(token.isValid()) - input.headers.insert("Authorization", "Bearer " + token.getToken()); + QStringList scope1; + scope1.append("write:pets"); + scope1.append("read:pets"); + auto token1 = _implicitFlow.getToken(scope1.join(" ")); + if(token1.isValid()) + input.headers.insert("Authorization", "Bearer " + token1.getToken()); _latestWorker = new PFXHttpRequestWorker(this, _manager); _latestWorker->setTimeOut(_timeOut); @@ -1240,7 +1240,7 @@ void PFXPetApi::updatePetWithForm(const qint64 &pet_id, const ::test_namespace:: }); _latestInput = input; - _latestScope = scope; + _latestScope = scope1; @@ -1351,12 +1351,12 @@ void PFXPetApi::uploadFile(const qint64 &pet_id, const ::test_namespace::Optiona _passwordFlow.unlink(); _authFlow.unlink(); _credentialFlow.unlink(); - QStringList scope; - scope.append("write:pets"); - scope.append("read:pets"); - auto token = _implicitFlow.getToken(scope.join(" ")); - if(token.isValid()) - input.headers.insert("Authorization", "Bearer " + token.getToken()); + QStringList scope1; + scope1.append("write:pets"); + scope1.append("read:pets"); + auto token1 = _implicitFlow.getToken(scope1.join(" ")); + if(token1.isValid()) + input.headers.insert("Authorization", "Bearer " + token1.getToken()); _latestWorker = new PFXHttpRequestWorker(this, _manager); _latestWorker->setTimeOut(_timeOut); @@ -1371,7 +1371,7 @@ void PFXPetApi::uploadFile(const qint64 &pet_id, const ::test_namespace::Optiona }); _latestInput = input; - _latestScope = scope; + _latestScope = scope1;