diff options
Diffstat (limited to 'gtad/gtad.yaml')
-rw-r--r-- | gtad/gtad.yaml | 74 |
1 files changed, 48 insertions, 26 deletions
diff --git a/gtad/gtad.yaml b/gtad/gtad.yaml index e56c394d..4b05d2d4 100644 --- a/gtad/gtad.yaml +++ b/gtad/gtad.yaml @@ -29,6 +29,8 @@ analyzer: login>/user: "" login>/medium: "" login>/address: "" + login</home_server: "" + register</home_server: "" # Structure inside `types`: # - swaggerType: <targetTypeSpec> @@ -45,7 +47,7 @@ analyzer: types: - +set: &UseOmittable useOmittable: - omittedValue: 'none' # Quotient::none in lib/util.h + omittedValue: 'none' # Quotient::none in lib/omittable.h +on: - integer: - int64: qint64 @@ -68,6 +70,9 @@ analyzer: - dateTime: type: QDateTime initializer: QDateTime::fromString("{{defaultValue}}") + - uri: + type: QUrl + initializer: QUrl::fromEncoded("{{defaultValue}}") - //: &QString type: QString initializer: QStringLiteral("{{defaultValue}}") @@ -79,14 +84,19 @@ analyzer: - $ref: - +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 + - /state_event.yaml$/: + type: StateEventPtr + imports: '"events/stateevent.h"' + - /(room|client)_event.yaml$/: + type: RoomEventPtr + imports: '"events/roomevent.h"' + - /event(_without_room_id)?.yaml$/: + type: EventPtr + imports: '"events/event.h"' - +set: - # This renderer actually applies to all $ref things + # This renderer applies to everything actually $ref'ed + # (not substituted) _importRenderer: '"{{#segments}}{{_}}{{#_join}}/{{/_join}}{{/segments}}.h"' +on: - '/^(\./)?definitions/request_email_validation.yaml$/': @@ -94,49 +104,64 @@ analyzer: - '/^(\./)?definitions/request_msisdn_validation.yaml$/': title: MsisdnValidationData - /_filter.yaml$/: # Event/RoomEventFilters do NOT need Omittable<> + + # Despite being used in two calls, it's more practical to have those + # fields available as getters right from the respective job classes - /public_rooms_response.yaml$/: { _inline: true } + + # list_public_rooms.yaml (via public_rooms_response.yaml) and + # space_hierarchy.yaml use public_rooms_chunk.yaml as a common base + # structure, adding (space_hiearchy) or overriding + # (public_rooms_response) fields for their purposes. The spec text + # confusingly ends up with having two different structures named + # "PublicRoomsChunk". To make sure the types are distinct in + # libQuotient, this common base is inlined into the actually used + # data structures (that have distinct names) defined + # in space_hierarchy.h and public_rooms_response.h, respectively + - /public_rooms_chunk.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"' # - getFilter<: *Filter + - StrippedChildStateEvent: void # only used in an array, see below - RoomFilter: # A structure inside Filter, same story as with *_filter.yaml + - OneTimeKeys: + type: OneTimeKeys + imports: '"e2ee/e2ee.h"' - //: *UseOmittable - array: - string: QStringList - +set: { moveOnly: } +on: - - /^Notification|Result$/: - type: "std::vector<{{1}}>" - imports: '"events/eventloader.h"' - - /m\.room\.member/: # Only used in an array (see also above) - type: "EventsArray<RoomMemberEvent>" - imports: '"events/roommemberevent.h"' - - /state_event.yaml$/: StateEvents - - /room_event.yaml$/: RoomEvents - - /event.yaml$/: Events + - /^Notification|Result|ChildRoomsChunk$/: "std::vector<{{1}}>" + - /^StrippedChildStateEvent$|state_event.yaml$/: + type: StateEvents + imports: '"events/stateevent.h"' # For StrippedChildStateEvent + - /(room|client)_event.yaml$/: RoomEvents + - /event(_without_room_id)?.yaml$/: Events - //: "QVector<{{1}}>" - map: # `additionalProperties` in OpenAPI - RoomState: type: "UnorderedMap<QString, {{1}}>" moveOnly: - /.+/: "QHash<QString, {{1}}>" - - //: QVariantHash - - variant: # A sequence `type` (multitype) in OpenAPI + - //: QVariantHash # QJsonObject?.. + - variant: # A sequence `type` or a 'oneOf' group in OpenAPI - /^string,null|null,string$/: *QString - //: QVariant #operations: mustache: +# delimiter: '%| |%' # or something else instead of '{{ }}' constants: # Syntax elements used by GTAD # _quote: '"' # Common quote for left and right # _leftQuote: '"' -# _rightQuote: '"' +# _rightQuote: '"_ls' _comment: '//' copyrightName: Kitsune Ral copyrightEmail: <kitsune-ral@users.sf.net> @@ -160,11 +185,8 @@ mustache: qualifiedMaybeOmittableType: "{{>openOmittable}}{{dataType.qualifiedName}}{{>closeOmittable}}" - ref: "{{#avoidCopy}}&{{/avoidCopy}}{{#moveOnly}}&&{{/moveOnly}}" maybeCrefType: - "{{#avoidCopy}}const {{/avoidCopy}}{{>maybeOmittableType}}{{>ref}}" - qualifiedMaybeCrefType: - "{{#avoidCopy}}const {{/avoidCopy}}{{>qualifiedMaybeOmittableType}}{{>ref}}" + "{{#avoidCopy}}const {{/avoidCopy}}{{>maybeOmittableType}}{{#avoidCopy}}&{{/avoidCopy}}" maybeCrefJsonObject: "{{^propertyMap}}const QJsonObject&{{/propertyMap}}\ @@ -186,8 +208,8 @@ mustache: joinedParamDef: "{{>maybeCrefType}} {{paramName}}{{>cjoin}}" passPathAndMaybeQuery: >- - QStringLiteral("{{basePathWithoutHost}}") - {{#pathParts}} % {{_}}{{/pathParts}}{{#queryParams?}}, + makePath("{{basePathWithoutHost}}"{{#pathParts}}, + {{_}}{{/pathParts}}){{#queryParams?}}, queryTo{{camelCaseOperationId}}( {{#queryParams}}{{paramName}}{{>cjoin}}{{/queryParams}}){{/queryParams?}} |