Ich habe n Satz von JSON-String. Wie kann ich sie nur in Java zusammenführen?JSON-Strukturen rekursiv zusammenführen
Die neuesten json überschreiben vorherige Informationen im Falle eines Konflikts. Arrays werden nicht zusammengeführt.
Beispiel
json Basis:
{
"plank" : {
"count" : 2,
"properties" : {
"type" : "oak",
"dimensions" : [5.0, 25, 25]
}
}
}
verschmelzen mit:
{
"plank" : {
"count" : 4,
"properties" : {
"dimensions" : [5.0, 12.5, 25]
}
},
"scrap" : {
"count" : 1,
}
}
werden:
{
"plank" : {
"count" : 4,
"properties" : {
"type" : "oak",
"dimensions" : [5.0, 12.5, 25]
}
},
"scrap" : {
"count" : 1,
}
}