I came across this question regarding replacing a non-existing field with another field's value. It explains the usage of modify-default-beta
operation. Example mentioned in the post:
Spec
[
{
"operation": "modify-default-beta",
"spec": {
"shipping_address": {
"address": "@(2,payment_address.address)"
}
}
}
]
Input A, where there is not shipping address
{
"payment_address": {
"address": "some address"
},
"shipping_address": {}
}
Produces output A, where the billing address is copied over
{
"payment_address" : {
"address" : "some address"
},
"shipping_address" : {
"address" : "some address"
}
}
What is the meaning of the "2" in @(2,payment_address.address)
. I tried this example here and it works even if I replace the "2" with a "3".