Trying to generate the following JSON for a geckoboard widget (trendline)
{
"item": [
{
"value": "274057"
},
[
"38594",
"39957",
"35316",
"35913",
"36668",
"45660",
"41949"
]
]
}
This is my model:
public class NumberAndSecondaryStat
{
[JsonProperty("item")]
public DataItem[] DataItems { get; set; }
[JsonProperty("")]
public List<string> TrendData { get; set; }
}
public class DataItem
{
[JsonProperty("value")]
public decimal? Value { get; set; }
}
Have a couple of issues with the resulting JSON, but my biggest problem is getting the property name to disappear.
My generated JSON:
"item": [
{
"value": 223.0
}
],
"": [
"100",
"102",
"105",
"109"
]
Exact same question here: C# class for specific JSON / Geckoboard / Trendline widget. Just not sure what the custom serializer rules should look like.