Skip to content

Commit 66c7b2f

Browse files
authored
feat cpp-qt-client: fix cast primitive to string (OpenAPITools#20000)
1 parent b66b7af commit 66c7b2f

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ void {{classname}}::{{nickname}}({{#allParams}}{{#required}}const {{{dataType}}}
391391
}
392392
fullPath.append(paramString);
393393
{{/isPrimitiveType}}{{#isPrimitiveType}}
394-
fullPath.append(QUrl::toPercentEncoding("{{baseName}}")).append(querySuffix).append(QUrl::toPercentEncoding({{paramName}}{{^required}}.stringValue(){{/required}}));
394+
fullPath.append(QUrl::toPercentEncoding("{{baseName}}")).append(querySuffix).append(QUrl::toPercentEncoding(::{{cppNamespace}}::toStringValue({{paramName}}{{^required}}.stringValue(){{/required}})));
395395
{{/isPrimitiveType}}
396396
{{/collectionFormat}}
397397
{{#collectionFormat}}

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,7 @@ void PFXUserApi::loginUser(const QString &username, const QString &password) {
635635
else
636636
fullPath.append("?");
637637

638-
fullPath.append(QUrl::toPercentEncoding("username")).append(querySuffix).append(QUrl::toPercentEncoding(username));
638+
fullPath.append(QUrl::toPercentEncoding("username")).append(querySuffix).append(QUrl::toPercentEncoding(::test_namespace::toStringValue(username)));
639639
}
640640

641641
{
@@ -650,7 +650,7 @@ void PFXUserApi::loginUser(const QString &username, const QString &password) {
650650
else
651651
fullPath.append("?");
652652

653-
fullPath.append(QUrl::toPercentEncoding("password")).append(querySuffix).append(QUrl::toPercentEncoding(password));
653+
fullPath.append(QUrl::toPercentEncoding("password")).append(querySuffix).append(QUrl::toPercentEncoding(::test_namespace::toStringValue(password)));
654654
}
655655
PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this, _manager);
656656
worker->setTimeOut(_timeOut);

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,7 @@ void PFXUserApi::loginUser(const QString &username, const QString &password) {
635635
else
636636
fullPath.append("?");
637637

638-
fullPath.append(QUrl::toPercentEncoding("username")).append(querySuffix).append(QUrl::toPercentEncoding(username));
638+
fullPath.append(QUrl::toPercentEncoding("username")).append(querySuffix).append(QUrl::toPercentEncoding(::test_namespace::toStringValue(username)));
639639
}
640640

641641
{
@@ -650,7 +650,7 @@ void PFXUserApi::loginUser(const QString &username, const QString &password) {
650650
else
651651
fullPath.append("?");
652652

653-
fullPath.append(QUrl::toPercentEncoding("password")).append(querySuffix).append(QUrl::toPercentEncoding(password));
653+
fullPath.append(QUrl::toPercentEncoding("password")).append(querySuffix).append(QUrl::toPercentEncoding(::test_namespace::toStringValue(password)));
654654
}
655655
PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this, _manager);
656656
worker->setTimeOut(_timeOut);

0 commit comments

Comments
 (0)