I have a JSON string.
[
{
"target":"FDOL00001",
"datapoints":[
{
"y":72.564,
"x":1523858700
}
]
},
{
"target":"FDOL00001",
"datapoints":[
{
"y":86.366,
"x":1523858700
}
]
},
{
"target":"FDOL00001",
"datapoints":[
{
"y":73.90195818815343,
"x":1523858700
}
]
}
]
I am trying to deserialize it into a collection. But I get an error message. Can someone direct me on the right path to fix this?
class datapoint
{
[JsonProperty("x")]
public int x { get; set; }
[JsonProperty("y")]
public decimal y { get; set; }
}
class jsonMapper
{
[JsonProperty("target")]
public string target { get; set; }
[JsonProperty("datapoints")]
public datapoint datapoints { get; set; }
}
I am trying to convert using the following code.
var json = JsonConvert.DeserializeObject<List<jsonMapper>>(objText);
The error I get is
JSON (, [1,2,3]) "ISSPortal2.datapoint", JSON (, {\ "name \":\ "value \" }) .\r\n , JSON JSON (, {\ "name \":\ "value \" }), , (, ICollection, IList), List, JSON. JsonArrayAttribute , JSON.\R\nPath '[0].datapoints', 1, 40.
. .
. , . :)