I'm trying to create a list of dictionaries, from a list of dictionaries which contains a key with a dictionary as a value. So, I want a list of dictionaries each with the contents of that key.
Starting from:
orig_dictionary:
- key1:
name: key1val_a
extra_a: test
key2:
name: key2val_a
extra_a: test
- key1:
name: key1val_a
key2:
name: key2val_a
- key2:
name: key2val_a
extra_b: test
I'm tying to get,
new_dictionary:
- name: key2val_a
extra_a: test
- name: key2val_a
- name: key2val_a
extra_b: test
I've used map with an extract filter followed by the list filter, but I end up getting a string for some reason. Using jinja2 style filters, how can I do this?