Skip to content

Commit

Permalink
Fix joining of mapping_path
Browse files Browse the repository at this point in the history
  • Loading branch information
ocelotl committed Nov 1, 2023
1 parent 56449d5 commit ee01912
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,17 @@ def traverse_configuration(schema_dictionary, configuration_dictionary):
def traverse(
schema_dictionary, configuration_dictionary, mapping_path
):
print(mapping_path)
print("/".join(mapping_path))
# print(mapping_path)

if "properties" in schema_dictionary.keys():
mapping_path[-1] = f"{mapping_path[-1]}/properties"
if mapping_path:
mapping_path[-1] = f"{mapping_path[-1]}/properties"
else:
mapping_path.append("properties")
schema_dictionary = schema_dictionary["properties"]

elif "items" in schema_dictionary.keys():
mapping_path[-1] = f"{mapping_path[-1]}/items"
schema_dictionary = schema_dictionary["items"]
if "properties" in schema_dictionary.keys():
mapping_path[-1] = f"{mapping_path[-1]}/properties"
Expand Down Expand Up @@ -151,7 +154,7 @@ def traverse(
mapping_path
)

mapping_path = ["tree"]
mapping_path = []

traverse(schema_dictionary, configuration_dictionary, mapping_path)

Expand Down

0 comments on commit ee01912

Please sign in to comment.