[Qt5 C++] Replace illegal characters in param names for Qt5 generator (#3978)

* Fix illegal characters in param names

* Re-generate the petstore sample
This commit is contained in:
Ragnis Armus
2016-10-15 13:23:36 +03:00
committed by wing328
parent 7b092122d6
commit dee2dd8d36
18 changed files with 374 additions and 98 deletions

View File

@@ -24,7 +24,7 @@ void
fullPath.append(this->host).append(this->basePath).append("{{path}}");
{{#pathParams}}
QString {{paramName}}PathParam("{"); {{paramName}}PathParam.append("{{paramName}}").append("}");
QString {{paramName}}PathParam("{"); {{paramName}}PathParam.append("{{baseName}}").append("}");
fullPath.replace({{paramName}}PathParam, stringValue({{paramName}}));
{{/pathParams}}
@@ -34,7 +34,7 @@ void
fullPath.append("&");
else
fullPath.append("?");
fullPath.append(QUrl::toPercentEncoding("{{paramName}}"))
fullPath.append(QUrl::toPercentEncoding("{{baseName}}"))
.append("=")
.append(QUrl::toPercentEncoding(stringValue({{paramName}})));
{{/collectionFormat}}
@@ -48,7 +48,7 @@ void
fullPath.append("&");
else
fullPath.append("?");
fullPath.append("{{{paramName}}}=").append(stringValue(t));
fullPath.append("{{{baseName}}}=").append(stringValue(t));
}
}
else if (QString("{{collectionFormat}}").indexOf("ssv") == 0) {
@@ -56,7 +56,7 @@ void
fullPath.append("&");
else
fullPath.append("?");
fullPath.append("{{paramName}}=");
fullPath.append("{{baseName}}=");
qint32 count = 0;
foreach({{{baseType}}} t, *{{paramName}}) {
if (count > 0) {
@@ -70,7 +70,7 @@ void
fullPath.append("&");
else
fullPath.append("?");
fullPath.append("{{paramName}}=");
fullPath.append("{{baseName}}=");
qint32 count = 0;
foreach({{{baseType}}} t, *{{paramName}}) {
if (count > 0) {
@@ -88,7 +88,7 @@ void
HttpRequestInput input(fullPath, "{{httpMethod}}");
{{#formParams}}if ({{paramName}} != NULL) {
{{^isFile}}input.add_var("{{paramName}}", *{{paramName}});{{/isFile}}{{#isFile}}input.add_file("{{paramName}}", (*{{paramName}}).local_filename, (*{{paramName}}).request_filename, (*{{paramName}}).mime_type);{{/isFile}}
{{^isFile}}input.add_var("{{baseName}}", *{{paramName}});{{/isFile}}{{#isFile}}input.add_file("{{baseName}}", (*{{paramName}}).local_filename, (*{{paramName}}).request_filename, (*{{paramName}}).mime_type);{{/isFile}}
}
{{/formParams}}