mirror of
https://github.com/matrix-org/matrix-spec
synced 2026-04-24 03:34:14 +02:00
Make nested titles better
This commit is contained in:
parent
cb4fcd1d09
commit
042772aaf5
|
|
@ -298,12 +298,12 @@ def process_data_type(prop, required=False, enforce_title=True):
|
||||||
# Items can be a list of schemas or a schema itself
|
# Items can be a list of schemas or a schema itself
|
||||||
# http://json-schema.org/latest/json-schema-validation.html#rfc.section.6.4
|
# http://json-schema.org/latest/json-schema-validation.html#rfc.section.6.4
|
||||||
if isinstance(items, list):
|
if isinstance(items, list):
|
||||||
prop_title = "["
|
nested_titles = []
|
||||||
for i in items:
|
for i in items:
|
||||||
nested = process_data_type(i)
|
nested = process_data_type(i)
|
||||||
tables.extend(nested['tables'])
|
tables.extend(nested['tables'])
|
||||||
prop_title = "%s%s, " % (prop_title, nested['title'])
|
nested_titles.extend([nested['title']])
|
||||||
prop_title = prop_title[:-2] + "]"
|
prop_title = "[%s]" % (", ".join(nested_titles), )
|
||||||
else:
|
else:
|
||||||
nested = process_data_type(prop["items"])
|
nested = process_data_type(prop["items"])
|
||||||
prop_title = "[%s]" % nested["title"]
|
prop_title = "[%s]" % nested["title"]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue