my approach would be to script it...
I'm gonna guess python?
def main():
my_string = "array: ['thing1', 'thing2', 'thing3'],"
my_string= my_string[8:-2] #remove array: [ ],
split_string=my_string.split(",")
result="objects: {\n"
for item in split_string:
result+="\t{\n"
result+=f"\t\tname: {item}\n"
result+="\t},\n"
result+="},\n"
print(result)
main()
result:
objects: {
{
name: 'thing1'
},
{
name: 'thing2'
},
{
name: 'thing3'
},
},