mirror of
https://github.com/matrix-org/matrix-spec
synced 2025-12-25 10:28:37 +01:00
Handle lists of types in arrays
This commit is contained in:
parent
e49ea9015f
commit
8070489080
|
|
@ -147,7 +147,10 @@ def get_json_schema_object_fields(obj, enforce_title=False, include_parents=Fals
|
||||||
value_type = "[%s]" % nested_object[0]["title"]
|
value_type = "[%s]" % nested_object[0]["title"]
|
||||||
tables += nested_object
|
tables += nested_object
|
||||||
else:
|
else:
|
||||||
value_type = "[%s]" % props[key_name]["items"]["type"]
|
value_type = props[key_name]["items"]["type"]
|
||||||
|
if isinstance(value_type, list):
|
||||||
|
value_type = " or ".join(value_type)
|
||||||
|
value_type = "[%s]" % value_type
|
||||||
array_enums = props[key_name]["items"].get("enum")
|
array_enums = props[key_name]["items"].get("enum")
|
||||||
if array_enums:
|
if array_enums:
|
||||||
if len(array_enums) > 1:
|
if len(array_enums) > 1:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue