using System.Collections.Generic;
using System.Globalization;
using static Converter.UrlDownloaderConverter;
CultureInfo.CurrentCulture = new CultureInfo("de-DE", false);
""a_date"": ""24.09.2021"",
""date_url"": ""https://www-api.aaa.com/api/HEUFCCEWJHB=.json""
""a_date"": ""27.09.2021"",
""date_url"": ""https://www-api.aaa.com/api/VFEWVWEWXS=.json""
""a_date"": ""24.10.2021"",
""date_url"": ""https://www-api.aaa.com/api/HBTFDECEC=.json""
""a_date"": ""27.10.2021"",
""date_url"": ""https://www-api.aaa.com/api/EWFEWIFWEW=.json""
Console.WriteLine(JsonSerializer.Serialize<List<Root>>(JsonSerializer.Deserialize<List<Root>>(input)));
using System.Text.Json.Serialization;
public class UrlDownloaderConverter : JsonConverter<object>
public override bool CanConvert (Type t) => true;
public override object Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
=> JsonSerializer.Deserialize(DownloadJson(reader.GetString()), typeToConvert, options);
public override void Write(Utf8JsonWriter writer, object value, JsonSerializerOptions options)
=> JsonSerializer.Serialize(writer, value, value.GetType(), options);
private static string DownloadJson(string url)
using (HttpClient httpClient = new HttpClient())
using (HttpResponseMessage msg = httpClient.GetAsync(url).Result)
using (HttpContent content = msg.Content)
return content.ReadAsStringAsync().Result;
public class FromURLAttribute : JsonConverterAttribute
public FromURLAttribute () : base (typeof(UrlDownloaderConverter)) {}
public string aa { get; set; }
public bool bb { get; set; }
public bool? cc { get; set; }
public string a_date { get; set; }
public bool push { get; set; }
public List<DateUrl> date_url { get; set; }
public string title { get; set; }
public List<Date> dates { get; set; }