aboutsummaryrefslogtreecommitdiff
path: root/gtad/gtad.yaml
diff options
context:
space:
mode:
Diffstat (limited to 'gtad/gtad.yaml')
-rw-r--r--gtad/gtad.yaml52
1 files changed, 29 insertions, 23 deletions
diff --git a/gtad/gtad.yaml b/gtad/gtad.yaml
index adf5024a..943ac013 100644
--- a/gtad/gtad.yaml
+++ b/gtad/gtad.yaml
@@ -68,6 +68,9 @@ analyzer:
- dateTime:
type: QDateTime
initializer: QDateTime::fromString("{{defaultValue}}")
+ - uri:
+ type: QUrl
+ initializer: QUrl::fromEncoded("{{defaultValue}}")
- //: &QString
type: QString
initializer: QStringLiteral("{{defaultValue}}")
@@ -77,28 +80,31 @@ analyzer:
+on:
- object: &QJsonObject { type: QJsonObject }
- $ref:
- - +set: { moveOnly: }
+ - +set:
+ moveOnly:
+ imports: '"events/eventloader.h"'
+ +on:
+ - /state_event.yaml$/: StateEventPtr
+ - /room_event.yaml$/: RoomEventPtr
+ - /event.yaml$/: EventPtr
+ - /m\.room\.member/: void # Skip resolving; see EventsArray<> below
+ - +set:
+ # This renderer actually applies to all $ref things
+ _importRenderer: '"{{#segments}}{{_}}{{#_join}}/{{/_join}}{{/segments}}.h"'
+on:
- - /state_event.yaml$/:
- { type: StateEventPtr, imports: "events/eventloader.h" }
- - /room_event.yaml$/:
- { type: RoomEventPtr, imports: "events/eventloader.h" }
- - /event.yaml$/:
- { type: EventPtr, imports: "events/eventloader.h" }
- - /m\.room\.member$/: void # Skip resolving; see EventsArray<> below
- - '/^(\./)?definitions/request_email_validation.yaml$/':
- title: EmailValidationData
- - '/^(\./)?definitions/request_msisdn_validation.yaml$/':
- title: MsisdnValidationData
- - /_filter.yaml$/: # Event/RoomEventFilters do NOT need Omittable<>
- - /public_rooms_response.yaml$/: { _inline: true }
- - //: *UseOmittable # Also apply "avoidCopy" to all other ref'ed types
+ - '/^(\./)?definitions/request_email_validation.yaml$/':
+ title: EmailValidationData
+ - '/^(\./)?definitions/request_msisdn_validation.yaml$/':
+ title: MsisdnValidationData
+ - /_filter.yaml$/: # Event/RoomEventFilters do NOT need Omittable<>
+ - /public_rooms_response.yaml$/: { _inline: true }
+ - //: *UseOmittable # Also apply "avoidCopy" to all other ref'ed types
- schema:
- getTurnServer<: *QJsonObject # It's used as an opaque JSON object
- PublicRoomResponse: { _inline: true }
# - defineFilter>: &Filter # Force folding into a structure
# type: Filter
-# imports: "csapi/definitions/sync_filter.h"
+# imports: '"csapi/definitions/sync_filter.h"'
# - getFilter<: *Filter
- RoomFilter: # A structure inside Filter, same story as with *_filter.yaml
- //: *UseOmittable
@@ -108,10 +114,10 @@ analyzer:
+on:
- /^Notification|Result$/:
type: "std::vector<{{1}}>"
- imports: "events/eventloader.h"
- - /m\.room\.member$/: # Only used in an array (see also above)
+ imports: '"events/eventloader.h"'
+ - /m\.room\.member/: # Only used in an array (see also above)
type: "EventsArray<RoomMemberEvent>"
- imports: "events/roommemberevent.h"
+ imports: '"events/roommemberevent.h"'
- /state_event.yaml$/: StateEvents
- /room_event.yaml$/: RoomEvents
- /event.yaml$/: Events
@@ -129,12 +135,12 @@ analyzer:
#operations:
mustache:
+# delimiter: '%| |%' # or something else instead of '{{ }}'
constants:
# Syntax elements used by GTAD
# _quote: '"' # Common quote for left and right
# _leftQuote: '"'
-# _rightQuote: '"'
-# _joinChar: ',' # The character used by {{_join}} - not working yet
+# _rightQuote: '"_ls'
_comment: '//'
copyrightName: Kitsune Ral
copyrightEmail: <kitsune-ral@users.sf.net>
@@ -184,8 +190,8 @@ mustache:
joinedParamDef: "{{>maybeCrefType}} {{paramName}}{{>cjoin}}"
passPathAndMaybeQuery: >-
- QStringLiteral("{{basePathWithoutHost}}")
- {{#pathParts}} % {{_}}{{/pathParts}}{{#queryParams?}},
+ makePath("{{basePathWithoutHost}}"{{#pathParts}},
+ {{_}}{{/pathParts}}){{#queryParams?}},
queryTo{{camelCaseOperationId}}(
{{#queryParams}}{{paramName}}{{>cjoin}}{{/queryParams}}){{/queryParams?}}