aboutsummaryrefslogtreecommitdiff
path: root/jobs/{{base}}.cpp.mustache
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2017-11-30 03:36:29 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2017-11-30 03:36:29 +0900
commitbcdede472add732c49c95564034c8cfa1c38c725 (patch)
treef8a67ed14c6439633ec4ddc7f2bb16e235ce97fd /jobs/{{base}}.cpp.mustache
parent357625eb55e2f4569bb487ffe14a9236188e25f3 (diff)
downloadlibquotient-bcdede472add732c49c95564034c8cfa1c38c725.tar.gz
libquotient-bcdede472add732c49c95564034c8cfa1c38c725.zip
Generated jobs: Apply naming convention to parameters
It's now camelCase everywhere, even if The Spec uses snake_case (it is not consistent in that respect).
Diffstat (limited to 'jobs/{{base}}.cpp.mustache')
-rw-r--r--jobs/{{base}}.cpp.mustache6
1 files changed, 3 insertions, 3 deletions
diff --git a/jobs/{{base}}.cpp.mustache b/jobs/{{base}}.cpp.mustache
index f3a6dc59..31b867fa 100644
--- a/jobs/{{base}}.cpp.mustache
+++ b/jobs/{{base}}.cpp.mustache
@@ -2,7 +2,7 @@
#include "{{filenameBase}}.h"
-{{^models}}#include "jobs/converters.h"{{/models}}
+{{^models}}#include "converters.h"{{/models}}
{{#operations}}#include <QtCore/QStringBuilder>{{/operations}}
using namespace QMatrixClient;
@@ -35,7 +35,7 @@ class {{camelCaseOperationId}}Job::Private
{{/ properties?}}{{/normalResponse?}}{{/responses}}
{{camelCaseOperationId}}Job::{{camelCaseOperationId}}Job({{#allParams}}{{#avoidCopy?}}const {{dataType}}&{{/avoidCopy?}}{{^avoidCopy?}}{{dataType}}{{/avoidCopy?}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}})
: BaseJob(HttpVerb::{{#@cap}}{{#@tolower}}{{httpMethod}}{{/@tolower}}{{/@cap}}, "{{camelCaseOperationId}}Job",
- basePath{{#pathParts}} % {{part}}{{/pathParts}},
+ basePath{{#pathParts}} % {{.}}{{/pathParts}},
Query {{^queryParams}}{ }{{/queryParams}}{{#queryParams?}}{
{{#queryParams}}{ "{{baseName}}", toJson({{paramName}}).toString() }{{#hasMore}},
{{/hasMore}}{{/queryParams}}
@@ -69,7 +69,7 @@ BaseJob::Status {{camelCaseOperationId}}Job::parseJson(const QJsonDocument& data
{{# properties}}{{#required?}}if (!json.contains("{{paramName}}"))
return { JsonParseError,
"The key '{{paramName}}' not found in the response" };{{/required?}}
- d->{{paramName}} = fromJson<{{dataType}}>(json.value("{{paramName}}"));
+ d->{{paramName}} = fromJson<{{dataType}}>(json.value("{{baseName}}"));
{{/ properties}}
return Success;
}{{/ returnFile?}}