我的 JSON 数据如下所示:
[{
"coverageResponse": "100000\/500000\/1000000",
"insuranceLine": "COMMERCIAL",
"coverageCategory": "COVERAGE",
"carriers": [{
"carrierId": "LMICO",
"states": "GA, CA",
"excludedStates": "PA, NY"
}, {
"carrierId": "CNICO",
"states": "NY, PA",
"excludedStates": "CA, MI, OH"
}]
},
{
"coverageResponse": "222\/333\/111",
"insuranceLine": "COMMERCIAL",
"coverageCategory": "COVERAGE",
"carriers": [{
"carrierId": "LMICO",
"states": "GA, CA",
"excludedStates": "PA, NY"
}, {
"carrierId": "CNICO",
"states": "NY, PA",
"excludedStates": "CA, MI, OH"
}]
}]
我希望states里面excludedStates的内容carriers出现在列表中
这是我的输出期望:
[{
"coverageResponse": "100000\/500000\/1000000",
"insuranceLine": "COMMERCIAL",
"coverageCategory": "COVERAGE",
"carriers": [{
"carrierId": "LMICO",
"states": ["GA, CA"],
"excludedStates": ["PA, NY"]
}, {
"carrierId": "CNICO",
"states": ["NY, PA"],
"excludedStates": ["CA, MI, OH"]
}]
},
{
"coverageResponse": "222\/333\/111",
"insuranceLine": "COMMERCIAL",
"coverageCategory": "COVERAGE",
"carriers": [{
"carrierId": "LMICO",
"states": "GA, CA",
"excludedStates": "PA, NY"
}, {
"carrierId": "CNICO",
"states": "NY, PA",
"excludedStates": "CA, MI, OH"
}]
}]
弑天下
相关分类