aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--jobs/gtad.yaml1
-rw-r--r--jobs/{{base}}.cpp.mustache25
2 files changed, 14 insertions, 12 deletions
diff --git a/jobs/gtad.yaml b/jobs/gtad.yaml
index ad8dc80f..54f70cdb 100644
--- a/jobs/gtad.yaml
+++ b/jobs/gtad.yaml
@@ -73,6 +73,7 @@ env:
maybeCrefType: "{{#avoidCopy?}}const {{/avoidCopy?}}{{dataType.name}}{{#avoidCopy?}}&{{/avoidCopy?}}"
qualifiedMaybeCrefType: "{{#avoidCopy?}}const {{/avoidCopy?}}{{dataType.qualifiedName}}{{#avoidCopy?}}&{{/avoidCopy?}}"
initializeDefaultValue: "{{#defaultValue}}{{>initializer}}{{/defaultValue}}{{^defaultValue}}{}{{/defaultValue}}"
+ paramToString: '{{#string?}}{{nameCamelCase}}{{/string?}}{{^string?}}QString("%1").arg({{nameCamelCase}}){{/string?}}'
# preamble: preamble.mustache
copyrightName: Kitsune Ral
copyrightEmail: <kitsune-ral@users.sf.net>
diff --git a/jobs/{{base}}.cpp.mustache b/jobs/{{base}}.cpp.mustache
index 1461dec5..0726d523 100644
--- a/jobs/{{base}}.cpp.mustache
+++ b/jobs/{{base}}.cpp.mustache
@@ -59,23 +59,24 @@ class {{camelCaseOperationId}}Job::Private
{{/ allProperties?}}{{/normalResponse?}}{{/responses}}
{{camelCaseOperationId}}Job::{{camelCaseOperationId}}Job({{#allParams}}{{>maybeCrefType}} {{paramName}}{{#@join}}, {{/@join}}{{/allParams}})
: BaseJob(HttpVerb::{{#@cap}}{{#@tolower}}{{httpMethod}}{{/@tolower}}{{/@cap}}, "{{camelCaseOperationId}}Job",
- basePath{{#pathParts}} % {{_}}{{/pathParts}},
- Query {{^queryParams}}{ }{{/queryParams}}{{#queryParams?}}{
- {{#queryParams}}{ "{{baseName}}", toJson({{paramName}}).toString() }{{#@join}},
- {{/@join}}{{/queryParams}}
- }{{/queryParams?}}{{#skipAuth}}, Data { }, false{{/skipAuth}}
- ){{#responses}}{{#normalResponse?}}{{#allProperties?}}, d(new Private){{/allProperties?}}{{/normalResponse?}}{{/responses}}
-{{#bodyParams?}}{
+ basePath{{#pathParts}} % {{_}}{{/pathParts}}{{#skipAuth}}, false{{/skipAuth}}){{#responses}}{{#normalResponse?}}{{#allProperties?}}
+ , d(new Private){{/allProperties?}}{{/normalResponse?}}{{/responses}}
+{
{{#headerParams?}}{{#headerParams}} setRequestHeader("{{baseName}}", {{paramName}}.toLatin1());
{{/headerParams}}
-{{/headerParams?}}{{#inlineBody}} setRequestData(Data({{paramName}}));{{/inlineBody}}{{!
+{{/headerParams?}}{{!
+}}{{#queryParams?}} QUrlQuery _q;{{#queryParams}}
+{{^required?}}{{#string?}} if (!{{nameCamelCase}}.isEmpty())
+ {{/string?}}{{/required?}} _q.addQueryItem("{{baseName}}", {{>paramToString}});{{/queryParams}}
+ setRequestQuery(_q);
+{{/queryParams?}}{{#bodyParams?}}{{!
+}}{{#inlineBody}} setRequestData(Data({{nameCamelCase}}));{{/inlineBody}}{{!
}}{{^inlineBody}} QJsonObject _data;{{#bodyParams}}
{{^required?}}{{#string?}} if (!{{paramName}}.isEmpty())
{{/string?}}{{/required?}} _data.insert("{{baseName}}", toJson({{paramName}}));{{/bodyParams}}
- setRequestData(_data);{{/inlineBody}}{{#produces?}}
-{{#produces}}
- addExpectedContentType("{{_}}");{{/produces}}{{/produces?}}
-}{{/bodyParams?}}{{^bodyParams?}}{ }{{/bodyParams?}}
+ setRequestData(_data);{{/inlineBody}}
+{{/bodyParams?}}{{#producesNotJson?}} setExpectedContentTypes({ {{#produces}}"{{_}}"{{#@join}}, {{/@join}}{{/produces}} });
+{{/producesNotJson?}}}{{!<- mind the actual brace}}
{{# responses}}{{#normalResponse?}}{{#allProperties?}}
{{camelCaseOperationId}}Job::~{{camelCaseOperationId}}Job() = default;
{{# allProperties}}