Skip to content

Commit a0ba95b

Browse files
committed
[cpp-qt-client]Fix variable redeclarations in the api-body.mustache
1 parent b1022e7 commit a0ba95b

File tree

3 files changed

+81
-81
lines changed

3 files changed

+81
-81
lines changed

modules/openapi-generator/src/main/resources/cpp-qt-client/api-body.mustache

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -702,13 +702,13 @@ void {{classname}}::{{nickname}}({{#allParams}}{{#required}}const {{{dataType}}}
702702
_credentialFlow.unlink();
703703
_passwordFlow.unlink();
704704
_authFlow.link();
705-
QStringList scope;
705+
QStringList scope2;
706706
{{#scopes}}
707-
scope.append("{{scope}}");
707+
scope2.append("{{scope}}");
708708
{{/scopes}}
709-
auto token = _authFlow.getToken(scope.join(" "));
710-
if(token.isValid())
711-
input.headers.insert("Authorization", "Bearer " + token.getToken());
709+
auto token2 = _authFlow.getToken(scope2.join(" "));
710+
if(token2.isValid())
711+
input.headers.insert("Authorization", "Bearer " + token2.getToken());
712712

713713
_latestWorker = new {{prefix}}HttpRequestWorker(this, _manager);
714714
_latestWorker->setTimeOut(_timeOut);
@@ -725,20 +725,20 @@ void {{classname}}::{{nickname}}({{#allParams}}{{#required}}const {{{dataType}}}
725725
});
726726

727727
_latestInput = input;
728-
_latestScope = scope;{{/isCode}}
728+
_latestScope = scope2;{{/isCode}}
729729
{{#isImplicit}}
730730
_OauthMethod = 1;
731731
_implicitFlow.link();
732732
_passwordFlow.unlink();
733733
_authFlow.unlink();
734734
_credentialFlow.unlink();
735-
QStringList scope;
735+
QStringList scope1;
736736
{{#scopes}}
737-
scope.append("{{scope}}");
737+
scope1.append("{{scope}}");
738738
{{/scopes}}
739-
auto token = _implicitFlow.getToken(scope.join(" "));
740-
if(token.isValid())
741-
input.headers.insert("Authorization", "Bearer " + token.getToken());
739+
auto token1 = _implicitFlow.getToken(scope1.join(" "));
740+
if(token1.isValid())
741+
input.headers.insert("Authorization", "Bearer " + token1.getToken());
742742

743743
_latestWorker = new {{prefix}}HttpRequestWorker(this, _manager);
744744
_latestWorker->setTimeOut(_timeOut);
@@ -749,26 +749,26 @@ void {{classname}}::{{nickname}}({{#allParams}}{{#required}}const {{{dataType}}}
749749
connect(_latestWorker, &{{prefix}}HttpRequestWorker::on_execution_finished, this, &{{classname}}::{{nickname}}Callback);
750750
connect(this, &{{classname}}::abortRequestsSignal, _latestWorker, &QObject::deleteLater);
751751
connect(_latestWorker, &QObject::destroyed, this, [this] {
752-
if(findChildren<{{prefix}}HttpRequestWorker*>().count() == 0){
752+
if(findChildren<{{prefix}}HttpRequestWorker4*>().count() == 0){
753753
Q_EMIT allPendingRequestsCompleted();
754754
}
755755
});
756756

757757
_latestInput = input;
758-
_latestScope = scope;{{/isImplicit}}
758+
_latestScope = scope1;{{/isImplicit}}
759759
{{#isApplication}}
760760
_OauthMethod = 3;
761761
_authFlow.unlink();
762762
_implicitFlow.unlink();
763763
_passwordFlow.unlink();
764764
_credentialFlow.link();
765-
QStringList scope;
765+
QStringList scope3;
766766
{{#scopes}}
767-
scope.append("{{scope}}");
767+
scope3.append("{{scope}}");
768768
{{/scopes}}
769-
auto token = _credentialFlow.getToken(scope.join(" "));
770-
if(token.isValid())
771-
input.headers.insert("Authorization", "Bearer " + token.getToken());
769+
auto token3 = _credentialFlow.getToken(scope3.join(" "));
770+
if(token3.isValid())
771+
input.headers.insert("Authorization", "Bearer " + token3.getToken());
772772

773773
_latestWorker = new {{prefix}}HttpRequestWorker(this, _manager);
774774
_latestWorker->setTimeOut(_timeOut);
@@ -785,20 +785,20 @@ void {{classname}}::{{nickname}}({{#allParams}}{{#required}}const {{{dataType}}}
785785
});
786786

787787
_latestInput = input;
788-
_latestScope = scope;{{/isApplication}}
788+
_latestScope = scope3;{{/isApplication}}
789789
{{#isPassword}}
790790
_OauthMethod = 4;
791791
_passwordFlow.link();
792792
_authFlow.unlink();
793793
_implicitFlow.unlink();
794794
_credentialFlow.unlink();
795-
QStringList scope;
795+
QStringList scope4;
796796
{{#scopes}}
797-
scope.append("{{scope}}");
797+
scope4.append("{{scope}}");
798798
{{/scopes}}
799-
auto token = _passwordFlow.getToken(scope.join(" "));
800-
if(token.isValid())
801-
input.headers.insert("Authorization", "Bearer " + token.getToken());
799+
auto token4 = _passwordFlow.getToken(scope4.join(" "));
800+
if(token4.isValid())
801+
input.headers.insert("Authorization", "Bearer " + token4.getToken());
802802

803803
_latestWorker = new {{prefix}}HttpRequestWorker(this, _manager);
804804
_latestWorker->setTimeOut(_timeOut);
@@ -815,7 +815,7 @@ void {{classname}}::{{nickname}}({{#allParams}}{{#required}}const {{{dataType}}}
815815
});
816816

817817
_latestInput = input;
818-
_latestScope = scope;
818+
_latestScope = scope4;
819819
{{/isPassword}}{{/isOAuth}}{{/authMethods}}
820820

821821
worker->execute(&input);

samples/client/petstore/cpp-qt-addDownloadProgress/client/PFXPetApi.cpp

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -269,10 +269,10 @@ void PFXPetApi::addPet(const PFXPet &pfx_pet) {
269269
_passwordFlow.unlink();
270270
_authFlow.unlink();
271271
_credentialFlow.unlink();
272-
QStringList scope;
273-
scope.append("write:pets");
274-
scope.append("read:pets");
275-
auto token = _implicitFlow.getToken(scope.join(" "));
272+
QStringList scope1;
273+
scope1.append("write:pets");
274+
scope1.append("read:pets");
275+
token = _implicitFlow.getToken(scope1.join(" "));
276276
if(token.isValid())
277277
input.headers.insert("Authorization", "Bearer " + token.getToken());
278278

@@ -477,10 +477,10 @@ void PFXPetApi::deletePet(const qint64 &pet_id, const ::test_namespace::Optional
477477
_passwordFlow.unlink();
478478
_authFlow.unlink();
479479
_credentialFlow.unlink();
480-
QStringList scope;
481-
scope.append("write:pets");
482-
scope.append("read:pets");
483-
auto token = _implicitFlow.getToken(scope.join(" "));
480+
QStringList scope1;
481+
scope1.append("write:pets");
482+
scope1.append("read:pets");
483+
token = _implicitFlow.getToken(scope1.join(" "));
484484
if(token.isValid())
485485
input.headers.insert("Authorization", "Bearer " + token.getToken());
486486

@@ -672,10 +672,10 @@ void PFXPetApi::findPetsByStatus(const QList<QString> &status) {
672672
_passwordFlow.unlink();
673673
_authFlow.unlink();
674674
_credentialFlow.unlink();
675-
QStringList scope;
676-
scope.append("write:pets");
677-
scope.append("read:pets");
678-
auto token = _implicitFlow.getToken(scope.join(" "));
675+
QStringList scope1;
676+
scope1.append("write:pets");
677+
scope1.append("read:pets");
678+
token = _implicitFlow.getToken(scope1.join(" "));
679679
if(token.isValid())
680680
input.headers.insert("Authorization", "Bearer " + token.getToken());
681681

@@ -877,10 +877,10 @@ void PFXPetApi::findPetsByTags(const QList<QString> &tags) {
877877
_passwordFlow.unlink();
878878
_authFlow.unlink();
879879
_credentialFlow.unlink();
880-
QStringList scope;
881-
scope.append("write:pets");
882-
scope.append("read:pets");
883-
auto token = _implicitFlow.getToken(scope.join(" "));
880+
QStringList scope1;
881+
scope1.append("write:pets");
882+
scope1.append("read:pets");
883+
token = _implicitFlow.getToken(scope1.join(" "));
884884
if(token.isValid())
885885
input.headers.insert("Authorization", "Bearer " + token.getToken());
886886

@@ -1089,10 +1089,10 @@ void PFXPetApi::updatePet(const PFXPet &pfx_pet) {
10891089
_passwordFlow.unlink();
10901090
_authFlow.unlink();
10911091
_credentialFlow.unlink();
1092-
QStringList scope;
1093-
scope.append("write:pets");
1094-
scope.append("read:pets");
1095-
auto token = _implicitFlow.getToken(scope.join(" "));
1092+
QStringList scope1;
1093+
scope1.append("write:pets");
1094+
scope1.append("read:pets");
1095+
token = _implicitFlow.getToken(scope1.join(" "));
10961096
if(token.isValid())
10971097
input.headers.insert("Authorization", "Bearer " + token.getToken());
10981098

@@ -1220,10 +1220,10 @@ void PFXPetApi::updatePetWithForm(const qint64 &pet_id, const ::test_namespace::
12201220
_passwordFlow.unlink();
12211221
_authFlow.unlink();
12221222
_credentialFlow.unlink();
1223-
QStringList scope;
1224-
scope.append("write:pets");
1225-
scope.append("read:pets");
1226-
auto token = _implicitFlow.getToken(scope.join(" "));
1223+
QStringList scope1;
1224+
scope1.append("write:pets");
1225+
scope1.append("read:pets");
1226+
token = _implicitFlow.getToken(scope1.join(" "));
12271227
if(token.isValid())
12281228
input.headers.insert("Authorization", "Bearer " + token.getToken());
12291229

@@ -1351,10 +1351,10 @@ void PFXPetApi::uploadFile(const qint64 &pet_id, const ::test_namespace::Optiona
13511351
_passwordFlow.unlink();
13521352
_authFlow.unlink();
13531353
_credentialFlow.unlink();
1354-
QStringList scope;
1355-
scope.append("write:pets");
1356-
scope.append("read:pets");
1357-
auto token = _implicitFlow.getToken(scope.join(" "));
1354+
QStringList scope1;
1355+
scope1.append("write:pets");
1356+
scope1.append("read:pets");
1357+
token = _implicitFlow.getToken(scope1.join(" "));
13581358
if(token.isValid())
13591359
input.headers.insert("Authorization", "Bearer " + token.getToken());
13601360

samples/client/petstore/cpp-qt/client/PFXPetApi.cpp

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -269,10 +269,10 @@ void PFXPetApi::addPet(const PFXPet &pfx_pet) {
269269
_passwordFlow.unlink();
270270
_authFlow.unlink();
271271
_credentialFlow.unlink();
272-
QStringList scope;
273-
scope.append("write:pets");
274-
scope.append("read:pets");
275-
auto token = _implicitFlow.getToken(scope.join(" "));
272+
QStringList scope1;
273+
scope1.append("write:pets");
274+
scope1.append("read:pets");
275+
token = _implicitFlow.getToken(scope1.join(" "));
276276
if(token.isValid())
277277
input.headers.insert("Authorization", "Bearer " + token.getToken());
278278

@@ -477,10 +477,10 @@ void PFXPetApi::deletePet(const qint64 &pet_id, const ::test_namespace::Optional
477477
_passwordFlow.unlink();
478478
_authFlow.unlink();
479479
_credentialFlow.unlink();
480-
QStringList scope;
481-
scope.append("write:pets");
482-
scope.append("read:pets");
483-
auto token = _implicitFlow.getToken(scope.join(" "));
480+
QStringList scope1;
481+
scope1.append("write:pets");
482+
scope1.append("read:pets");
483+
token = _implicitFlow.getToken(scope1.join(" "));
484484
if(token.isValid())
485485
input.headers.insert("Authorization", "Bearer " + token.getToken());
486486

@@ -672,10 +672,10 @@ void PFXPetApi::findPetsByStatus(const QList<QString> &status) {
672672
_passwordFlow.unlink();
673673
_authFlow.unlink();
674674
_credentialFlow.unlink();
675-
QStringList scope;
676-
scope.append("write:pets");
677-
scope.append("read:pets");
678-
auto token = _implicitFlow.getToken(scope.join(" "));
675+
QStringList scope1;
676+
scope1.append("write:pets");
677+
scope1.append("read:pets");
678+
token = _implicitFlow.getToken(scope1.join(" "));
679679
if(token.isValid())
680680
input.headers.insert("Authorization", "Bearer " + token.getToken());
681681

@@ -877,10 +877,10 @@ void PFXPetApi::findPetsByTags(const QList<QString> &tags) {
877877
_passwordFlow.unlink();
878878
_authFlow.unlink();
879879
_credentialFlow.unlink();
880-
QStringList scope;
881-
scope.append("write:pets");
882-
scope.append("read:pets");
883-
auto token = _implicitFlow.getToken(scope.join(" "));
880+
QStringList scope1;
881+
scope1.append("write:pets");
882+
scope1.append("read:pets");
883+
token = _implicitFlow.getToken(scope1.join(" "));
884884
if(token.isValid())
885885
input.headers.insert("Authorization", "Bearer " + token.getToken());
886886

@@ -1089,10 +1089,10 @@ void PFXPetApi::updatePet(const PFXPet &pfx_pet) {
10891089
_passwordFlow.unlink();
10901090
_authFlow.unlink();
10911091
_credentialFlow.unlink();
1092-
QStringList scope;
1093-
scope.append("write:pets");
1094-
scope.append("read:pets");
1095-
auto token = _implicitFlow.getToken(scope.join(" "));
1092+
QStringList scope1;
1093+
scope1.append("write:pets");
1094+
scope1.append("read:pets");
1095+
token = _implicitFlow.getToken(scope1.join(" "));
10961096
if(token.isValid())
10971097
input.headers.insert("Authorization", "Bearer " + token.getToken());
10981098

@@ -1220,10 +1220,10 @@ void PFXPetApi::updatePetWithForm(const qint64 &pet_id, const ::test_namespace::
12201220
_passwordFlow.unlink();
12211221
_authFlow.unlink();
12221222
_credentialFlow.unlink();
1223-
QStringList scope;
1224-
scope.append("write:pets");
1225-
scope.append("read:pets");
1226-
auto token = _implicitFlow.getToken(scope.join(" "));
1223+
QStringList scope1;
1224+
scope1.append("write:pets");
1225+
scope1.append("read:pets");
1226+
token = _implicitFlow.getToken(scope1.join(" "));
12271227
if(token.isValid())
12281228
input.headers.insert("Authorization", "Bearer " + token.getToken());
12291229

@@ -1351,10 +1351,10 @@ void PFXPetApi::uploadFile(const qint64 &pet_id, const ::test_namespace::Optiona
13511351
_passwordFlow.unlink();
13521352
_authFlow.unlink();
13531353
_credentialFlow.unlink();
1354-
QStringList scope;
1355-
scope.append("write:pets");
1356-
scope.append("read:pets");
1357-
auto token = _implicitFlow.getToken(scope.join(" "));
1354+
QStringList scope1;
1355+
scope1.append("write:pets");
1356+
scope1.append("read:pets");
1357+
token = _implicitFlow.getToken(scope1.join(" "));
13581358
if(token.isValid())
13591359
input.headers.insert("Authorization", "Bearer " + token.getToken());
13601360

0 commit comments

Comments
 (0)