diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-05-26 20:17:34 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-05-26 20:17:34 +0900 |
commit | c5d06cf378e820ca4290998a5580e87957daf061 (patch) | |
tree | d015ee3dc3a0beea2ecb42e47bd052f7d2bfd294 /lib/csapi/{{base}}.h.mustache | |
parent | c03d9b0a595caf8a2d3fbc225625c0e9a083a95c (diff) | |
download | libquotient-c5d06cf378e820ca4290998a5580e87957daf061.tar.gz libquotient-c5d06cf378e820ca4290998a5580e87957daf061.zip |
lib/csapi/: Don't send parameters that were omitted
This is important because payloads that include omitted parameters may be malformed. Closes #208 (an example of such malformed payload).
Diffstat (limited to 'lib/csapi/{{base}}.h.mustache')
-rw-r--r-- | lib/csapi/{{base}}.h.mustache | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/csapi/{{base}}.h.mustache b/lib/csapi/{{base}}.h.mustache index 2eb2c656..6f08e871 100644 --- a/lib/csapi/{{base}}.h.mustache +++ b/lib/csapi/{{base}}.h.mustache @@ -14,7 +14,9 @@ namespace QMatrixClient struct {{name}}{{#parents?}} : {{#parents}}{{name}}{{#@join}}, {{/@join}}{{/parents}}{{/parents?}} { {{#vars}} {{dataType.name}} {{nameCamelCase}}; -{{/vars}} }; +{{/vars}}{{#in?}} + bool omitted; +{{/in?}} }; {{#in?}} QJsonObject toJson(const {{name}}& pod); {{/in?}}{{#out?}} @@ -33,7 +35,9 @@ namespace QMatrixClient struct {{name}}{{#parents?}} : {{#parents}}{{name}}{{#@join}}, {{/@join}}{{/parents}}{{/parents?}} { {{#vars}} {{dataType.name}} {{nameCamelCase}}; -{{/vars}} }; +{{/vars}}{{#in?}} + bool omitted; +{{/in?}} }; {{/ model}} // Construction/destruction {{/ models}} |