Facebook グラフ API を使用してページを検索しています。https://graph.facebook.com/search?q=platform&type=page
これがjsonの応答です。1つだけ含めました。
{
"data": [
{
"category": "Media/news/publishing",
"category_list": [
{
"id": "108366235907857",
"name": "Newspaper"
}
],
"name": "Arab News",
"id": "10250877124"
}
],
"paging": {
"next": "https://graph.facebook.com/search?limit=1&offset=1&type=page&q=media&__after_id=10250877124"
}
}
さて、C# での私のクラスは次のとおりです。
public class CategoryList
{
[JsonProperty("id")]
public string Id { get; set; }
[JsonProperty("name")]
public string Name { get; set; }
}
public class DataRoot
{
[JsonProperty("category")]
public string Category { get; set; }
[JsonProperty("name")]
public string Name { get; set; }
[JsonProperty("id")]
public string Id { get; set; }
[JsonProperty("category_list")]
public CategoryList[] CategoryList { get; set; }
}
public class Paging
{
[JsonProperty("next")]
public string Next { get; set; }
}
public class FacebookPageResults
{
[JsonProperty("data")]
public DataRoot[] Data { get; set; }
[JsonProperty("paging")]
public Paging Paging { get; set; }
}
これは奇妙なことです。逆シリアル化しようとすると
FacebookPageResults response = new JavaScriptSerializer().Deserialize<FacebookPageResults>(res);
、CategoryList は常に null になり、いっぱいになりません。List CategoryList {get; を試してみました。set;} しかし、結果は同じですか?
これに関するヘルプまたは回避策