if isinstance(structure, list):
    for v in structure:
        ret.extend(flatten(v))
elif isinstance(structure, dict):
    for k, v in list(structure.items()):
        ret.extend(k + '/' + f for f in flatten(v))
return ret
print(sorted(flatten(structure)))
Flatten Arbitrary Length of Dictionary Items Into List of Paths in Python