Add title/desc to lots of event schemas, add missing keys (e.g. avatar_url, displayname), add required keys section to spec.
This commit is contained in:
parent
c237c9010a
commit
c61223fb27
16 changed files with 107 additions and 9 deletions
|
@ -62,14 +62,16 @@ def _load_schemas():
|
|||
for filename in os.listdir(path):
|
||||
if not filename.startswith("m."):
|
||||
continue
|
||||
print "Reading %s" % os.path.join(path, filename)
|
||||
with open(os.path.join(path, filename), "r") as f:
|
||||
json_schema = json.loads(f.read())
|
||||
json_schema = json.loads(f.read(), strict=False)
|
||||
schema = {
|
||||
"typeof": None,
|
||||
"type": None,
|
||||
"summary": None,
|
||||
"desc": None,
|
||||
"json_format": None
|
||||
"json_format": None,
|
||||
"required_keys": None
|
||||
}
|
||||
|
||||
# add typeof
|
||||
|
@ -94,6 +96,12 @@ def _load_schemas():
|
|||
if content_props:
|
||||
schema["json_format"] = format_for_obj(content_props)
|
||||
|
||||
# add required_keys
|
||||
schema["required_keys"] = prop(
|
||||
json_schema, "properties/content/required"
|
||||
)
|
||||
|
||||
|
||||
|
||||
schemata[filename] = schema
|
||||
return schemata
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue