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/gtad.yaml | |
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/gtad.yaml')
-rw-r--r-- | lib/csapi/gtad.yaml | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/csapi/gtad.yaml b/lib/csapi/gtad.yaml index c7cbc73d..cb68ad1b 100644 --- a/lib/csapi/gtad.yaml +++ b/lib/csapi/gtad.yaml @@ -27,12 +27,10 @@ analyzer: number: - float: float - //: double - boolean: { type: bool, initializer: false } + boolean: { type: bool, omitted: false } string: - byte: &ByteStream type: QIODevice* - #initializer: '"{{defaultValue}}"' - #string?: true imports: <QtCore/QIODevice> - binary: *ByteStream - date: @@ -114,6 +112,8 @@ analyzer: imports: '"variant_converters.h"' schema: # Properties of inline structure definitions avoidCopy?: true + omitted: omitted<{{dataType.name}}>() + imports: '"converters.h"' #operations: @@ -121,10 +121,12 @@ mustache: definitions: _scopeRenderer: "{{scopeCamelCase}}Job::" _literalQuote: '"' + # Default value for omitted + omitted: '{}' maybeCrefType: "{{#avoidCopy?}}const {{/avoidCopy?}}{{dataType.name}}{{#avoidCopy?}}&{{/avoidCopy?}}{{#noCopy?}}&&{{/noCopy?}}" qualifiedMaybeCrefType: "{{#avoidCopy?}}const {{/avoidCopy?}}{{dataType.qualifiedName}}{{#avoidCopy?}}&{{/avoidCopy?}}{{#noCopy?}}&&{{/noCopy?}}" - initializeDefaultValue: "{{#defaultValue}}{{>initializer}}{{/defaultValue}}{{^defaultValue}}{}{{/defaultValue}}" + initializeDefaultValue: "{{#defaultValue}}{{#initializer}}{{>initializer}}{{/initializer}}{{/defaultValue}}{{^defaultValue}}{{>omitted}}{{/defaultValue}}" joinedParamDecl: '{{>maybeCrefType}} {{paramName}}{{^required?}} = {{>initializeDefaultValue}}{{/required?}}{{#@join}}, {{/@join}}' joinedParamDef: '{{>maybeCrefType}} {{paramName}}{{#@join}}, {{/@join}}' passQueryParams: '{{#queryParams}}{{paramName}}{{#@join}}, {{/@join}}{{/queryParams}}' |