title: Can't deserialize JSON from REST API (Wordpress) using RestSharp
body: <p>This has been driving me nuts - I can't deserialize some JSON I'm getting back from the Wordpress public API to get my posts. I'm using RestSharp. The data I'm getting back shows a blog post, but all the properties are null. I even used Json2CSharp to model my "Post" class after what's returned.</p>
  
  <p>Here's my JSON:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>{
     "found":1,
     "posts":[
        {
           "ID":2,
           "site_ID":89749867,
           "author":{
              "ID":2988648,
              "login":"loginname",
              "email":false,
              "name":"loginname",
              "nice_name":"loginname",
              "URL":"",
              "avatar_URL":"https:\/\/2.gravatar.com\/avatar\/e78ee2e2f7bb75a8bc5339a6bd20194e?s=96&amp;d=identicon&amp;r=G",
              "profile_URL":"http:\/\/en.gravatar.com\/loginname",
              "site_ID":2918427
           },
           "date":"2015-04-20T18:16:18+00:00",
           "modified":"2015-04-20T18:18:20+00:00",
           "title":"Hello world!",
           "URL":"https:\/\/myblog.wordpress.com\/2015\/04\/20\/hello-world\/",
           "short_URL":"http:\/\/wp.me\/p64A2v-2",
           "content":"&lt;p&gt;&lt;a href=\"https:\/\/myblog.files.wordpress.com\/2015\/04\/left_shark_5x3.png\"&gt;&lt;img class=\"alignnone size-medium wp-image-3\" src=\"https:\/\/myblog.files.wordpress.com\/2015\/04\/left_shark_5x3.png?w=300&amp;#038;h=180\" alt=\"Left Shark\" width=\"300\" height=\"180\" \/&gt;&lt;\/a&gt;&lt;\/p&gt;\n&lt;p&gt;This is your very first post. Click the Edit link to modify or delete it, or &lt;a title=\"Direct link to Add New Post in your Dashboard\" href=\"https:\/\/wordpress.com\/post\"&gt;start a new post&lt;\/a&gt;. If you like, use this post to tell readers why you started this blog and what you plan to do with it.&lt;\/p&gt;\n&lt;p&gt;Happy blogging!&lt;\/p&gt;\n",
           "excerpt":"&lt;p&gt;This is your very first post. Click the Edit link to modify or delete it, or start a new post. If you like, use this post to tell readers why you started this blog and what you plan to do with it. Happy blogging!&lt;\/p&gt;\n",
           "slug":"hello-world",
           "guid":"http:\/\/myblog.wordpress.com\/?p=1",
           "status":"publish",
           "sticky":false,
           "password":"",
           "parent":false,
           "type":"post",
           "discussion":{
              "comments_open":true,
              "comment_status":"open",
              "pings_open":true,
              "ping_status":"open",
              "comment_count":0
           },
           "likes_enabled":true,
           "sharing_enabled":true,
           "like_count":0,
           "i_like":0,
           "is_reblogged":0,
           "is_following":0,
           "global_ID":"7a5ad608c4e80f7c2463eead8d34f435",
           "featured_image":"https:\/\/myblog.files.wordpress.com\/2015\/04\/left_shark_5x3.png",
           "post_thumbnail":{
              "ID":3,
              "URL":"https:\/\/myblog.files.wordpress.com\/2015\/04\/left_shark_5x3.png",
              "guid":"http:\/\/myblog.files.wordpress.com\/2015\/04\/left_shark_5x3.png",
              "mime_type":"image\/png",
              "width":620,
              "height":372
           },
           "format":"standard",
           "geo":false,
           "menu_order":0,
           "page_template":"",
           "publicize_URLs":[
  
           ],
           "tags":{
  
           },
           "categories":{
              "Uncategorized":{
                 "ID":1,
                 "name":"Uncategorized",
                 "slug":"uncategorized",
                 "description":"",
                 "post_count":1,
                 "parent":0,
                 "meta":{
                    "links":{
                       "self":"https:\/\/public-api.wordpress.com\/rest\/v1.1\/sites\/89749867\/categories\/slug:uncategorized",
                       "help":"https:\/\/public-api.wordpress.com\/rest\/v1.1\/sites\/89749867\/categories\/slug:uncategorized\/help",
                       "site":"https:\/\/public-api.wordpress.com\/rest\/v1.1\/sites\/89749867"
                    }
                 }
              }
           },
           "attachments":{
              "3":{
                 "ID":3,
                 "URL":"https:\/\/myblog.files.wordpress.com\/2015\/04\/left_shark_5x3.png",
                 "guid":"http:\/\/myblog.files.wordpress.com\/2015\/04\/left_shark_5x3.png",
                 "date":"2015-04-20T18:17:33+00:00",
                 "post_ID":2,
                 "file":"left_shark_5x3.png",
                 "mime_type":"image\/png",
                 "extension":"png",
                 "title":"Left Shark",
                 "caption":"",
                 "description":"",
                 "alt":"Left Shark",
                 "thumbnails":{
  
                 },
                 "height":372,
                 "width":620,
                 "exif":{
                    "aperture":0,
                    "credit":"",
                    "camera":"",
                    "caption":"",
                    "created_timestamp":0,
                    "copyright":"",
                    "focal_length":0,
                    "iso":0,
                    "shutter_speed":0,
                    "title":"",
                    "orientation":0
                 },
                 "meta":{
                    "links":{
                       "self":"https:\/\/public-api.wordpress.com\/rest\/v1.1\/sites\/89749867\/media\/3",
                       "help":"https:\/\/public-api.wordpress.com\/rest\/v1.1\/sites\/89749867\/media\/3\/help",
                       "site":"https:\/\/public-api.wordpress.com\/rest\/v1.1\/sites\/89749867",
                       "parent":"https:\/\/public-api.wordpress.com\/rest\/v1.1\/sites\/89749867\/posts\/2"
                    }
                 }
              }
           },
           "attachment_count":1,
           "metadata":[
              {
                 "id":"9",
                 "key":"_thumbnail_id",
                 "value":"3"
              }
           ],
           "meta":{
              "links":{
                 "self":"https:\/\/public-api.wordpress.com\/rest\/v1.1\/sites\/89749867\/posts\/2",
                 "help":"https:\/\/public-api.wordpress.com\/rest\/v1.1\/sites\/89749867\/posts\/2\/help",
                 "site":"https:\/\/public-api.wordpress.com\/rest\/v1.1\/sites\/89749867",
                 "replies":"https:\/\/public-api.wordpress.com\/rest\/v1.1\/sites\/89749867\/posts\/2\/replies\/",
                 "likes":"https:\/\/public-api.wordpress.com\/rest\/v1.1\/sites\/89749867\/posts\/2\/likes\/"
              }
           },
           "capabilities":{
              "publish_post":false,
              "delete_post":false,
              "edit_post":false
           }
        }
     ]
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>Here's my class (with some properties commented out so I didn't have to build those out:</p>
  
  <pre class="lang-cs prettyprint-override"><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Web;
  
  namespace thenickwilson_SPA_NEW.Models
  {
      public class Post
      {
          public int ID { get; set; }
          public int site_ID { get; set; }
          //public Author author { get; set; }
          public string date { get; set; }
          public string modified { get; set; }
          public string title { get; set; }
          public string URL { get; set; }
          public string short_URL { get; set; }
          public string content { get; set; }
          public string excerpt { get; set; }
          public string slug { get; set; }
          public string guid { get; set; }
          public string status { get; set; }
          public bool sticky { get; set; }
          public string password { get; set; }
          public bool parent { get; set; }
          public string type { get; set; }
          //public Discussion discussion { get; set; }
          public bool likes_enabled { get; set; }
          public bool sharing_enabled { get; set; }
          public int like_count { get; set; }
          public int i_like { get; set; }
          public int is_reblogged { get; set; }
          public int is_following { get; set; }
          public string global_ID { get; set; }
          public string featured_image { get; set; }
          //public PostThumbnail post_thumbnail { get; set; }
          public string format { get; set; }
          public bool geo { get; set; }
          public int menu_order { get; set; }
          public string page_template { get; set; }
          public List&lt;object&gt; publicize_URLs { get; set; }
          //public Tags tags { get; set; }
          //public Categories categories { get; set; }
          //public Attachments attachments { get; set; }
          public int attachment_count { get; set; }
          //public List&lt;Metadata&gt; metadata { get; set; }
          //public Meta3 meta { get; set; }
          //public Capabilities capabilities { get; set; }
      }
  }
  </code></pre>
  
  <p>And here's the rest of my code:</p>
  
  <pre class="lang-cs prettyprint-override"><code>[ResponseType(typeof(Post))]
          public IHttpActionResult Get()
          {
              var client = new RestClient("http://public-api.wordpress.com/rest/v1.1/");
              var request = new RestRequest("sites/{id}/posts", Method.GET);
              request.AddUrlSegment("id", "myblog.wordpress.com");
              request.RequestFormat = DataFormat.Json;
  
              var response = client.Execute&lt;List&lt;Post&gt;&gt;(request);
  
              return this.Ok(response);
          }
  </code></pre>
  
  <p>I have a feeling it has to do with the fact that the API returns a "found" element as well as "posts", but I'm not sure. Any help would be greatly appreciated.</p>