I'm trying to change a value in a nested json and turn it into an array.
This is the current json output:
print(response['Version']['Document'])
{
"Statement": [
{
"ID": "000"
"Resource": [
"a----",
"b----"
]
}
{
"Resource": "c----"
}
{
"ID": "000"
"Resource": [
"d----",
"e----"
]
}
]
}
I want to turn the value "Resource": "c----" into an array, so the desired output would look like this:
{
"Statement": [
{
"ID": "000"
"Resource": [
"a----",
"b----"
]
}
{
"Resource": [
"c----"
]
}
{
"Resource": [
"d----",
"e----"
]
}
]
}
What would be a good solution for this?