From 905263ceb5e2e13b862bec0a64f6d84eca3c2e9d Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Wed, 6 Dec 2017 19:15:51 +0900 Subject: GTAD pre-0.4, with local data types and parametrised arrays; make avoidCopy? actually work Along with this: - avoid copying of QStrings (unneeded convenience in our case) - even less empty lines --- jobs/gtad.yaml | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) (limited to 'jobs/gtad.yaml') diff --git a/jobs/gtad.yaml b/jobs/gtad.yaml index 4877aeb5..5f370ac5 100644 --- a/jobs/gtad.yaml +++ b/jobs/gtad.yaml @@ -1,8 +1,11 @@ preprocess: "%CLIENT_RELEASE_LABEL%": r0 "%CLIENT_MAJOR_VERSION%": r0 - "unsigned:": "unsigned_:" - "default:": "default_:" + # FIXME: the below only fixes C++ compilation but not actual work - the code + # will try to reach out for wrong values in JSON payloads + "signed:": "signedData:" + "unsigned:": "unsignedData:" + "default:": "isDefault:" # Structure: # swaggerType: @@ -29,25 +32,37 @@ types: string?: true imports: - binary: *QByteArray - - date: - type: QDate - avoidCopy?: true - imports: + - date: { type: QDate, "avoidCopy?": true, imports: } - dateTime: type: QDateTime avoidCopy?: true imports: - - //: { type: QString, "string?": true, imports: } + - //: + type: QString + string?: true + avoidCopy?: true + imports: file: type: QByteArray imports: - "returnFile?": true - object: { type: QJsonObject, "avoidCopy?": true, imports: } - array: { type: "QVector<{{1}}>", "avoidCopy?": true, imports: } + returnFile?: true + object: + type: QJsonObject + avoidCopy?: true + imports: + array: + - /.+/: + type: "QVector<{{1}}>" + avoidCopy?: true + imports: + - //: { type: QJsonArray, "avoidCopy?": true, imports: } #operations: env: + _typeRenderer: "{{#scope}}{{scopeCamelCase}}Job::{{/scope}}{{name}}" + maybeCrefType: "{{#avoidCopy?}}const {{/avoidCopy?}}{{dataType.name}}{{#avoidCopy?}}&{{/avoidCopy?}}" + qualifiedMaybeCrefType: "{{#avoidCopy?}}const {{/avoidCopy?}}{{dataType.qualifiedName}}{{#avoidCopy?}}&{{/avoidCopy?}}" # preamble: preamble.mustache copyrightName: Kitsune Ral copyrightEmail: -- cgit v1.2.3