I am working with a JSON file that comes with a specific structure, which when doing the deserialization process returns some of the values to null.
The source file that I am processing is the following:
{
"t":"i",
"v":
[
{
"id":604618,
"url":"http://wsplus.navego360.com/images/services/215/37480914/604618.jpg",
"last_log":
{
"t":"n",
"dt":"2018-08-16T19:03:47.962Z",
"c_lat":-12.014695,
"c_lon":-76.93001
}
},
{
"id":604619,
"url":"http://wsplus.navego360.com/images/services/215/37480914/604619.jpg",
"last_log":
{
"t":"n",
"dt":"2018-08-16T19:03:55.667Z",
"c_lat":-12.014695,
"c_lon":-76.93001
}
}
],
"st":"p"
}
This file can return several URLs with different photos, which I must be able to retrieve, regardless of whether it is just one URL or several.
The structure in C# that will receive the values is as follows:
public class ListaFotos
{
public string t { get; set; }
public List<FotoURL> fotos { get; set; }
public string st { get; set; }
}
public class FotoURL
{
public string id { get; set; }
public string url { get; set; }
public IDictionary<string, string> last_log { get; set; }
}
To convert to C# I am using the following line of code:
JsonConvert.DeserializeObject<DatosRetorno.ListaFotos>(jsonFotos);
The values that I am not receiving are those that are inside the list List<FotoURL>
, which corresponds to the "v" section of the JSON file, which is precisely the most important part, since the images that I must retrieve are located there.