Hello I am parsing a swagger file from an yaml. In order to find the schema I have to parse "#components/schemas/Login"
so in the end I end up with a list -> ['components', 'schemas', 'Login']
My question
How can I get to that level using this list?
The point is to get to
mydict['components']['schemas']['Login']
of course I can make a function
def get_to_dict_lvl_from_an_array(d, arr):
for i in arr:
d = d[i]
return d
which does the job, but is this the right and an elegant solution?