There are following 2 responses based on the value of env variable.
if env = Prod,
[
{
"_": {
"name": "FA",
"icon-url": "https://test.com/static/images/air/partner.png"
},
"@": {
"code": "00"
}
},
{
"_": {
"name": "DA",
"icon-url": "https://test.com/static/images/air/partner.png"
},
"@": {
"code": "0D"
}
}]
And we want to replace test.com with prod.com
if env is SIT
[
{
"code": "00",
"name": "FA",
"iconUrl": "https://test.com/static/images/air/partner.png"
},
{
"code": "0D",
"name": "DA",
"iconUrl": "https://test.com/static/images/air/partner.png"
}
]
The catch here is the iconUrl key name in both the responses is different. In case the env is Prod, we want to replace icon-url 'test.com' with 'prod.com' In case the env is SIT, we want to replace iconUrl 'test.com' with 'sit.com'