From 9a5673a1ccdf607486578d78412e580f41122dc4 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Thu, 7 Jan 2016 21:45:10 +0000 Subject: [PATCH] Reinstate event type info The 'typeof' info on the events was perpetrated by a fearsome hack which I broke. I don't want to fix it any better right now, so just make the hack work and pull the rug over. --- templating/matrix_templates/units.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/templating/matrix_templates/units.py b/templating/matrix_templates/units.py index e3a67b0a..10722f78 100644 --- a/templating/matrix_templates/units.py +++ b/templating/matrix_templates/units.py @@ -653,12 +653,15 @@ class MatrixUnits(Units): ROOM_EVENT: "Message Event", STATE_EVENT: "State Event" } + if type(json_schema.get("allOf")) == list: + schema["typeof"] = base_defs.get( + json_schema["allOf"][0].get("$ref") + ) + elif json_schema.get("title"): + schema["typeof"] = json_schema["title"] json_schema = resolve_references(filepath, json_schema) - if json_schema.get("title"): - schema["typeof"] = json_schema["title"] - # add type schema["type"] = Units.prop( json_schema, "properties/type/enum"