Note that there are some explanatory texts on larger screens.

plurals
  1. POTwitter : Cannot deserialize a JSON array into an object because the type requires a JSON object
    primarykey
    data
    text
    <p>I am using TweetSharp to retrieve tweets which in turn uses JSON.NET by Newtonsoft. And this is the app code, very simple.</p> <pre><code>ListTweetsOnUserTimelineOptions listTweetsOnUserTimelineOptions = new ListTweetsOnUserTimelineOptions(); listTweetsOnUserTimelineOptions.ScreenName = "MarilynDenisCTV"; listTweetsOnUserTimelineOptions.IncludeRts = false; var tweets = twitterService.ListTweetsOnUserTimeline(listTweetsOnUserTimelineOptions).Take(50); </code></pre> <p>There is one tweet that is giving me trouble. And the Exception I am getting is in this line of code in TweetSharp source. </p> <pre><code>public virtual object DeserializeJson(string content, Type type) { using (var stringReader = new StringReader(content)) { using (var jsonTextReader = new JsonTextReader(stringReader)) { return _serializer.Deserialize(jsonTextReader, type); } } } </code></pre> <p>This is the exception I am getting </p> <pre><code>Cannot deserialize the current JSON array (e.g. [1,2,3]) into type 'TweetSharp.TwitterStatus' because the type requires a JSON object (e.g. {"name":"value"}) to deserialize correctly. To fix this error either change the JSON to a JSON object (e.g. {"name":"value"}) or change the deserialized type to an array or a type that implements a collection interface (e.g. ICollection, IList) like List&lt;T&gt; that can be deserialized from a JSON array. JsonArrayAttribute can also be added to the type to force it to deserialize from a JSON array. Path '', </code></pre> <p>I downloaded the latest source from TweetSharp, but that doesn't seem to help, any ideas why? One more thing, the one problem tweet starts with [{"created_at": "Sun Nov 03 21:44:51 +0000 2013", as supposed to {"created_at": "Sun Nov 03 21:44:51 +0000 2013", it has the extra square bracket. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload