I have a variable that can look something like this:
('[{"path": ["$.parent_field.field_1"], "category": "A"}, {"path": ["$.field_2"], "category": "B"}, {"path": ["$.null_path"], "category": "C"}]',)
Essentially I'm looking for the best way to 'cycle through' the variable
What I want to end up with is something like:
parent_field.field_1 and field_2
So I'm essentially looking to extract the path fields (after the $.
) unless it is null_path
I've tried (where p is equal to the variable):
for i in p:
print(i)
but that is giving me i as:
[{"path": ["$.parent_field.field_1"], "category": "A"}, {"path": ["$.field_2"], "category": "B"}, {"path": ["$.null_path"], "category": "C"}]
And then I am unable to cycle through i as hoped