【发布时间】:2018-01-25 06:21:47
【问题描述】:
我有两个这样的 json 文件:
json1
{
"plans": {
"buildings": [
{
"floors": ["1" "2" "3" ]
},
{
"floors": ["1"]
}
]
}
}
json 2
{ "plans": {
"buildings": [
{
"floors": ["3" "5" "6" ]
},
{
"floors": []
}
]
}
}
合并联合后需要的json
{
"plans": {
"buildings": [
{
"floors": ["1","2","3","5","6" ]
},
{
"floors": ["1"]
}
]
}
}
如何通过使用可用工具获取 json diff 和合并修补来实现此操作。我不想遍历每个子节点并手动检查。
【问题讨论】:
标签: json merge json-patch