I'm trying to use Twitterizer and when trying to retrieve Mentions, I get a serialization error. In digging through the source, I found the problem in the PopulateObject method where there's no case for TokenType == EndArray.
The JSON being passed to the serializer is legitimate. The error happens at the end of the JSON on the last ].
JSON is:
[
{
"created_at": "Mon May 07 19:09:54 +0000 2012",
"id": 199576811758301200,
"id_str": "199576811758301184",
"text": "@appacap #movie #avengers #up #review Awesome! Loved the interaction of the characters, the editing was great. #josswhedon did a great job.",
"source": "web",
"truncated": false,
"in_reply_to_status_id": null,
"in_reply_to_status_id_str": null,
"in_reply_to_user_id": 572158334,
"in_reply_to_user_id_str": "572158334",
"in_reply_to_screen_name": "appacap",
"user": {
"id": 34389434,
"id_str": "34389434",
"name": "Textfyre, Inc.",
"screen_name": "Textfyre",
"location": "Chicago, IL",
"description": "Textfyre Adaptive Learning Entertainment. We publishing fun interactive content for reading-age students and consumers, both fiction and non-fiction.",
"url": "http://www.textfyre.com",
"protected": false,
"followers_count": 324,
"friends_count": 693,
"listed_count": 23,
"created_at": "Wed Apr 22 20:37:23 +0000 2009",
"favourites_count": 1,
"utc_offset": -21600,
"time_zone": "Central Time (US & Canada)",
"geo_enabled": true,
"verified": false,
"statuses_count": 409,
"lang": "en",
"contributors_enabled": false,
"is_translator": false,
"profile_background_color": "C0DEED",
"profile_background_image_url": "http://a0.twimg.com/images/themes/theme1/bg.png",
"profile_background_image_url_https": "https://si0.twimg.com/images/themes/theme1/bg.png",
"profile_background_tile": false,
"profile_image_url": "http://a0.twimg.com/profile_images/1902018291/Textfyre-T_normal.jpg",
"profile_image_url_https": "https://si0.twimg.com/profile_images/1902018291/Textfyre-T_normal.jpg",
"profile_link_color": "0084B4",
"profile_sidebar_border_color": "C0DEED",
"profile_sidebar_fill_color": "DDEEF6",
"profile_text_color": "333333",
"profile_use_background_image": true,
"show_all_inline_media": false,
"default_profile": true,
"default_profile_image": false,
"following": null,
"follow_request_sent": false,
"notifications": null
},
"geo": null,
"coordinates": null,
"place": null,
"contributors": null,
"retweet_count": 0,
"favorited": false,
"retweeted": false
}
]
?reader
{Newtonsoft.Json.JsonTextReader}
Newtonsoft.Json.JsonTextReader: {Newtonsoft.Json.JsonTextReader}
_culture: null
_currentPosition: {Newtonsoft.Json.JsonPosition}
_currentState: Finished
_dateParseHandling: DateTime
_dateTimeZoneHandling: RoundtripKind
_hasExceededMaxDepth: false
_maxDepth: null
_quoteChar: 34 '"'
_readType: Read
_stack: Count = 0
_tokenType: EndArray
_value: null
CloseInput: true
Culture: {}
CurrentState: Finished
DateParseHandling: DateTime
DateTimeZoneHandling: RoundtripKind
Depth: 0
MaxDepth: null
Path: ""
QuoteChar: 34 '"'
TokenType: EndArray
Value: null
ValueType: null
?newObject
"Textfyre"/"@appacap #movie #avengers #up #review Awesome! Loved the interaction of the characters, the editing was great. #josswhedon did a great job."
base {Twitterizer.Core.TwitterObject}: "Textfyre"/"@appacap #movie #avengers #up #review Awesome! Loved the interaction of the characters, the editing was great. #josswhedon did a great job."
CreatedDate: {5/7/2012 2:09:54 PM}
Entities: Count = 6
Geo: null
Id: 199576811758301184
InReplyToScreenName: "appacap"
InReplyToStatusId: null
InReplyToUserId: 572158334
IsFavorited: null
IsTruncated: false
Place: null
RetweetCount: 0
RetweetCountPlus: false
RetweetCountString: "0"
Retweeted: false
RetweetedStatus: null
Source: "web"
StringId: "199576811758301184"
Text: "@appacap #movie #avengers #up #review Awesome! Loved the interaction of the characters, the editing was great. #josswhedon did a great job."
User:
@"Textfyre"
?contract
{Newtonsoft.Json.Serialization.JsonObjectContract}
base {Newtonsoft.Json.Serialization.JsonContainerContract}: {Newtonsoft.Json.Serialization.JsonObjectContract}
ConstructorParameters: Count = 0
MemberSerialization: OptIn
OverrideConstructor: null
ParametrizedConstructor: null
Properties: Count = 20
?contract.Properties
Count = 20