From 38440a724acf8836e74e5bca29105e493f36eb7c Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Sun, 3 Jun 2018 17:12:35 +0900 Subject: csapi + converters: Support variant types (using QVariant) This mandated some rearrangement of toJson() overloads and FromJson<> specializations for QVariant* types - instead of variant_converters.h they are now in converters.cpp. --- lib/csapi/gtad.yaml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'lib/csapi') diff --git a/lib/csapi/gtad.yaml b/lib/csapi/gtad.yaml index e3afd473..fada9c83 100644 --- a/lib/csapi/gtad.yaml +++ b/lib/csapi/gtad.yaml @@ -50,7 +50,7 @@ analyzer: type: QDateTime initializer: QDateTime::fromString("{{defaultValue}}") imports: - - //: + - //: &QString type: QString initializer: QStringLiteral("{{defaultValue}}") isString: @@ -68,7 +68,7 @@ analyzer: - /event.yaml$/: { type: EventPtr, imports: '"events/event.h"' } - /m\.room\.member$/: pass # This $ref is only used in an array, see below - - //: # Apply "avoidCopy" to all other ref'ed types + - //: *UseOmittable # Also apply "avoidCopy" to all other ref'ed types - array: - string: { type: QStringList, imports: } - +set: { moveOnly: } @@ -96,9 +96,10 @@ analyzer: imports: - //: type: QVariantHash - imports: '"variant_converters.h"' + imports: - variant: # A sequence `type` (multitype) in OpenAPI - { type: QVariant, imports: '"variant_converters.h"' } + - "string|null": *QString + - //: { type: QVariant, imports: } - schema: # Properties of inline structure definitions *UseOmittable -- cgit v1.2.3