Update v1 paths, recursively print JSON format for arrays as well as objects.
This commit is contained in:
parent
92c85bda1d
commit
8643b4aadd
1 changed files with 8 additions and 2 deletions
|
@ -12,7 +12,7 @@ def prop(obj, path):
|
||||||
return val
|
return val
|
||||||
|
|
||||||
def _load_examples():
|
def _load_examples():
|
||||||
path = "../event-schemas/examples"
|
path = "../event-schemas/examples/v1"
|
||||||
examples = {}
|
examples = {}
|
||||||
for filename in os.listdir(path):
|
for filename in os.listdir(path):
|
||||||
if not filename.startswith("m."):
|
if not filename.startswith("m."):
|
||||||
|
@ -24,7 +24,7 @@ def _load_examples():
|
||||||
return examples
|
return examples
|
||||||
|
|
||||||
def _load_schemas():
|
def _load_schemas():
|
||||||
path = "../event-schemas/schema"
|
path = "../event-schemas/schema/v1"
|
||||||
schemata = {}
|
schemata = {}
|
||||||
|
|
||||||
def format_for_obj(obj):
|
def format_for_obj(obj):
|
||||||
|
@ -41,6 +41,12 @@ def _load_schemas():
|
||||||
"<%s>" % obj.get("additionalProperties").get("type")
|
"<%s>" % obj.get("additionalProperties").get("type")
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
elif obj_type == "<array>" and obj.get("items"):
|
||||||
|
return [
|
||||||
|
format_for_obj(obj.get("items"))
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
enum_text = ""
|
enum_text = ""
|
||||||
# add on enum info
|
# add on enum info
|
||||||
enum = obj.get("enum")
|
enum = obj.get("enum")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue