diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-06-16 18:43:23 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-06-16 18:43:23 +0900 |
commit | 1dd130831d406b526df274a9f9f9fb4ffd5a0d58 (patch) | |
tree | 543225396b563685fd5391c4f90a2d6a2ddf84ed /lib/csapi | |
parent | 0f3e1fd2e7e70af150c9b9dae654da6f5abdc6f8 (diff) | |
download | libquotient-1dd130831d406b526df274a9f9f9fb4ffd5a0d58.tar.gz libquotient-1dd130831d406b526df274a9f9f9fb4ffd5a0d58.zip |
csapi: Use {{>cjoin}} instead of {{>join,}}; fix a typo breaking update-api
Diffstat (limited to 'lib/csapi')
-rw-r--r-- | lib/csapi/gtad.yaml | 8 | ||||
-rw-r--r-- | lib/csapi/{{base}}.cpp.mustache | 2 | ||||
-rw-r--r-- | lib/csapi/{{base}}.h.mustache | 4 |
3 files changed, 7 insertions, 7 deletions
diff --git a/lib/csapi/gtad.yaml b/lib/csapi/gtad.yaml index 48e04477..3d1b7e88 100644 --- a/lib/csapi/gtad.yaml +++ b/lib/csapi/gtad.yaml @@ -113,7 +113,7 @@ mustache: _literalQuote: '"' omittedValue: '{}' # default value to initialize omitted parameters with initializer: '{{defaultValue}}' - join,: '{{#@join}}, {{/@join}}' + cjoin: '{{#@join}}, {{/@join}}' openOmittable: "{{^required?}}{{#useOmittable}}{{^defaultValue}}Omittable<{{/defaultValue}}{{/useOmittable}}{{/required?}}" closeOmittable: "{{^required?}}{{#useOmittable}}{{^defaultValue}}>{{/defaultValue}}{{/useOmittable}}{{/required?}}" maybeOmittableType: "{{>openOmittable}}{{dataType.name}}{{>closeOmittable}}" @@ -122,9 +122,9 @@ mustache: qualifiedMaybeCrefType: "{{#avoidCopy}}const {{/avoidCopy}}{{>qualifiedMaybeOmittableType}}{{#avoidCopy}}&{{/avoidCopy}}{{#moveOnly}}&&{{/moveOnly}}" initializeDefaultValue: "{{#defaultValue}}{{>initializer}}{{/defaultValue}}{{^defaultValue}}{{>omittedValue}}{{/defaultValue}}" - joinedParamDecl: '{{>maybeCrefType}} {{paramName}}{{^required?}} = {{>initializeDefaultValue}}{{/required?}}{{>join,}}' - joinedParamDef: '{{>maybeCrefType}} {{paramName}}{{>join,}}' - passQueryParams: '{{#queryParams}}{{paramName}}{{>join,}}{{/queryParams}}' + joinedParamDecl: '{{>maybeCrefType}} {{paramName}}{{^required?}} = {{>initializeDefaultValue}}{{/required?}}{{>cjoin}}' + joinedParamDef: '{{>maybeCrefType}} {{paramName}}{{>cjoin}}' + passQueryParams: '{{#queryParams}}{{paramName}}{{>cjoin}}{{/queryParams}}' # preamble: preamble.mustache copyrightName: Kitsune Ral copyrightEmail: <kitsune-ral@users.sf.net> diff --git a/lib/csapi/{{base}}.cpp.mustache b/lib/csapi/{{base}}.cpp.mustache index 4526bc79..8b5acd65 100644 --- a/lib/csapi/{{base}}.cpp.mustache +++ b/lib/csapi/{{base}}.cpp.mustache @@ -89,7 +89,7 @@ QUrl {{camelCaseOperationId}}Job::makeRequestUrl(QUrl baseUrl{{#allParams?}}, {{ }}{{^inlineBody}} QJsonObject _data;{{#bodyParams}} addParam<{{^required?}}IfNotEmpty{{/required?}}>(_data, "{{baseName}}", {{paramName}});{{/bodyParams}} setRequestData(_data);{{/inlineBody}} -{{/bodyParams?}}{{#producesNonJson?}} setExpectedContentTypes({ {{#produces}}"{{_}}"{{#@join,}}{{/produces}} }); +{{/bodyParams?}}{{#producesNonJson?}} setExpectedContentTypes({ {{#produces}}"{{_}}"{{>cjoin}}{{/produces}} }); {{/producesNonJson?}}}{{!<- mind the actual brace}} {{# responses}}{{#normalResponse?}}{{#allProperties?}} {{camelCaseOperationId}}Job::~{{camelCaseOperationId}}Job() = default; diff --git a/lib/csapi/{{base}}.h.mustache b/lib/csapi/{{base}}.h.mustache index 23d001cb..bd04ff08 100644 --- a/lib/csapi/{{base}}.h.mustache +++ b/lib/csapi/{{base}}.h.mustache @@ -11,7 +11,7 @@ namespace QMatrixClient { {{#models}} // Data structures {{# model}} - struct {{name}}{{#parents?}} : {{#parents}}{{name}}{{>join,}}{{/parents}}{{/parents?}} + struct {{name}}{{#parents?}} : {{#parents}}{{name}}{{>cjoin}}{{/parents}}{{/parents?}} { {{#vars}} {{>maybeOmittableType}} {{nameCamelCase}}; {{/vars}} }; @@ -30,7 +30,7 @@ namespace QMatrixClient public:{{#models}} // Inner data structures {{# model}} - struct {{name}}{{#parents?}} : {{#parents}}{{name}}{{>join,}}{{/parents}}{{/parents?}} + struct {{name}}{{#parents?}} : {{#parents}}{{name}}{{>cjoin}}{{/parents}}{{/parents?}} { {{#vars}} {{>maybeOmittableType}} {{nameCamelCase}}; {{/vars}} }; |