Cannot deserialize the current JSON object

Jira JSON Output

{"expand":"schema,names","startAt":0,"maxResults":50,"total":2350,"issues":[{"expand":"operations,editmeta,changelog,transitions,renderedFields","id":"1686803","self":"https://almtools/jira/rest/api/latest/issue/1686803","key":"TS-26271"},{"expand":"operations,editmeta,changelog,transitions,renderedFields","id":"1685941","self":"https://almtools/jira/rest/api/latest/issue/1685941","key":"TS-26268"},{"expand":"operations,editmeta,changelog,transitions,renderedFields","id":"1685807","self":"https://almtools/jira/rest/api/latest/issue/1685807","key":"TS-26266"}]}

Here's my code

    class IssueDetails
    {
        [JsonProperty("expand")]
        public string Expand { get; set; }

        [JsonProperty("startAt")]
        public int StartAt { get; set; }

        [JsonProperty("maxResults")]
        public int MaxResults { get; set; }

        [JsonProperty("total")]
        public int Total { get; set; }

        [JsonProperty("issues")]
        public List<Issues> IssueDescriptions { get; set; }

    
    }
    public class Issues
    {
        [JsonProperty("expand")]
        public string Expand { get; set; }
        
        [JsonProperty("id")]
        public int Id { get; set; }

        [JsonProperty("self")]
        public string Self { get; set; }

        [JsonProperty("key")]
        public string Key { get; set; }

    }

Im getting an error

{"Cannot deserialize the current JSON object (e.g. {\"name\":\"value\"}) into type 'System.Collections.Generic.List`1[frmEquationBacklogList.IssueDetails]' because the type requires a JSON array (e.g. [1,2,3]) to deserialize correctly.\r\nTo fix this error either change the JSON to a JSON array (e.g. [1,2,3]) or change the deserialized type so that it is a normal .NET type (e.g. not a primitive type like integer, not a collection type like an array or List<T>) that can be deserialized from a JSON object. JsonObjectAttribute can also be added to the type to force it to deserialize from a JSON object.\r\nPath 'expand', line 1, position 10."}

1 answer

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published yesterday in Jira Service Desk

Wy are we still using email for Service Desk workflows?

...attest to the experience of an urgent approval that gets lost in the boss’s inbox and requires that special “Please Approve” email or text message. In an age where we have distributed teams...

104 views 0 2
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you