I have an AWS step function as follows -
{
"StartAt": "S1",
"States": {
"S1": {
"Type": "Pass",
"Parameters": {
"Fruits.$": "$.Junk.Fruits"
},
"ResultPath": "$.Main.Fruits",
"Next": "S2"
},
"S2": {
"Type": "Pass",
"OutputPath": "$.Main",
"End": true
}
}
}
My input is as follows-
{
"Main": {
"Field": "field",
"Field2": "field2",
"Fruits":[]
},
"Junk": {
"Fruits":["apple", "banana", "papaya", "grapes"]
}
}
The output I obtain is as follows-
{
"Field": "field",
"Field2": "field2",
"Fruits": {
"Fruits": [
"apple",
"banana",
"papaya",
"grapes"
]
}
}
The output I want is as follows -
{
"Field": "field",
"Field2": "field2",
"Fruits": [ "apple", "banana", "papaya", "grapes" ]
}
Can you please rectify the step function so that I get the output I want. Please don't use lambda functions and please don't modify the input.