Fix spurious "None" in non-room events

Events like m.direct and m.tag don't inherit from either Message event or State
event, and were getting a "None" where there should have been a type.
This commit is contained in:
Richard van der Hoff 2016-10-13 17:23:11 +01:00
parent 3dd0fcabb3
commit 93894ebbbe
2 changed files with 8 additions and 6 deletions

View file

@ -680,7 +680,7 @@ class MatrixUnits(Units):
json_schema = yaml.load(f)
schema = {
"typeof": None,
"typeof": "",
"typeof_info": "",
"type": None,
"title": None,
@ -703,11 +703,9 @@ class MatrixUnits(Units):
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"]
firstRef = json_schema["allOf"][0]["$ref"]
if firstRef in base_defs:
schema["typeof"] = base_defs[firstRef]
json_schema = resolve_references(filepath, json_schema)