After an API request I get a JSON file(parent) with some URLs to other JSON files(children). Is it possible to download all files and convert the children files to JSON objects in a parent file?
It is a ASP.Net Core 3.1 application written in C#.
Example Input:
[
{
"title": "AAA",
"dates": [
{
"a_date": "24.09.2021",
"push": false,
"date_url": "https://www-api.aaa.com/api/HEUFCCEWJHB=.json"
},
{
"a_date": "27.09.2021",
"push": false,
"date_url": "https://www-api.aaa.com/api/VFEWVWEWXS=.json"
}
]
},
{
"title": "BBB",
"dates": [
{
"a_date": "24.10.2021",
"push": false,
"date_url": "https://www-api.aaa.com/api/HBTFDECEC=.json"
},
{
"a_date": "27.10.2021",
"push": false,
"date_url": "https://www-api.aaa.com/api/EWFEWIFWEW=.json"
}
]
}
]
Expected Output:
[
{
"title": "AAA",
"dates": [
{
"a_date": "24.09.2021",
"push": false,
"date_url": [
{
"aa": "xx",
"bb": false,
},
{
"aa": "zzz",
"cc": true,
}
]
},
{
"a_date": "27.09.2021",
"push": false,
"date_url": [
{
"aa": "xx",
"bb": false,
},
{
"aa": "zzz",
"cc": true,
}
]
}
]
},
{
"title": "BBB "
...
}
]
Optionaly:
At the end the parent JSON should be splitted in different JSON files by title.
Newtonsoft.JsonorSystem.Text.Json?"aa","bb","cc"mean in your Expected Output?