Using Facebook Search API, I got an response like:
"data" : [
{
"created_time" : "2010-07-24T19:47:31+0000",
"description" : "...",
"icon" : "...",
"id" : "1",
"link" : "...",
"name" : "...",
"type" : "link",
"updated_time" : "2010-07-24T19:47:31+0000"
},
{
"created_time" : "2010-07-24T14:57:51+0000",
"id" : "2",
"message" : "...",
"type" : "status",
"updated_time" : "2010-07-24T14:57:51+0000"
},
BTW, first variable isn't always "created_time"
. I need to change that type
attribute position due a DataContractJsonSerializer requirement for polymorphism:
Type Hint Position in JSON Objects Note that the type hint must appear first in the JSON representation. This is the only case where order of key/value pairs is important in JSON processing.
Result must be:
"data" : [
{
"__type" : "link:#Facebook",
"created_time" : "2010-07-24T19:47:31+0000",
"description" : "...",
"icon" : "...",
"id" : "1",
"link" : "...",
"name" : "...",
"updated_time" : "2010-07-24T19:47:31+0000"
},
{
"__type" : "status:#Facebook",
"created_time" : "2010-07-24T14:57:51+0000",
"id" : "2",
"message" : "...",
"updated_time" : "2010-07-24T14:57:51+0000"
},