I\'m calling the JIRA Rest API to recieve a list of Worklog Objects.
The JSON I recieve looks like.
{
\"startAt\": 0,
\"maxResults\": 1,
\"total\": 1,
\
Either create a "RootObject" class that does contain the properties:
public class RootObject
{
public int startAt { get; set; }
public int maxResults { get; set; }
public int total { get; set; }
public List worklogs { get; set; }
}
And deserialize into that:
var rootObject = JsonConvert.DeserializeObject(json);
// access rootObject.worklogs
Or step into the parsed JSON and deserialize from there:
JObject o = JObject.Parse(json);
JToken worklogsJson = o.SelectToken("worklogs");
var worklogs = worklogsJson.ToObject>();