Merging 2 different JSON objects
-
Hi, I have two JSON objects: JSON Object 1
[{
"date":
[
"date-value1",
"date-value2,
........ ,
"date-value729"
]
}]JSON Object 2
{
"data": [
{
"body": [ "body1" ],
"link": "link1",
"title": [ "title1" ]
},
...........
{
"body": [ "body729" ],
"link": "link729",
"title": [ "title729" ]
}
]
}How can I merge the properties of these 2 JSON objects and have the following example as an output for all 729 records of data:
{
"data": [
{
"body": [ "body1" ],
"link": "link1",
"title": [ "title1" ].
"date": "date1"
},
...........
{
"body": [ "body729" ],
"link": "link729",
"title": [ "title729" ]
"date": "date729"
}
]
}Examples that I found online are mainly about merging two identical JSON objects. Thank you in advance for your time and consideration.
-
Hi, I have two JSON objects: JSON Object 1
[{
"date":
[
"date-value1",
"date-value2,
........ ,
"date-value729"
]
}]JSON Object 2
{
"data": [
{
"body": [ "body1" ],
"link": "link1",
"title": [ "title1" ]
},
...........
{
"body": [ "body729" ],
"link": "link729",
"title": [ "title729" ]
}
]
}How can I merge the properties of these 2 JSON objects and have the following example as an output for all 729 records of data:
{
"data": [
{
"body": [ "body1" ],
"link": "link1",
"title": [ "title1" ].
"date": "date1"
},
...........
{
"body": [ "body729" ],
"link": "link729",
"title": [ "title729" ]
"date": "date729"
}
]
}Examples that I found online are mainly about merging two identical JSON objects. Thank you in advance for your time and consideration.
-
You would need to do it manually. Create a class for each type, and one that contains all the properties. Read the two sets into the first two classes, merge the properties into the third, and create a new JSON stream from that.
Thanks, it worked as you guided. I thought maybe there is already some sort of online tools to import and export such task.