parse str to json
This commit is contained in:
@@ -110,6 +110,8 @@ def get_size(path):
|
||||
def get_nested_value(data, dotted_key, default=None):
|
||||
keys = dotted_key.split('.')
|
||||
for key in keys:
|
||||
if isinstance(data, str):
|
||||
data = json.loads(data)
|
||||
if isinstance(data, dict) and key in data:
|
||||
data = data[key]
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user