title: JsonSerializer not working for nested objects using GSON
body: <p>I have a json object that looks like this:</p>
  
  <pre><code>{
      "user": {
          "id": 1234
          ... 
          "photos": [
              {
                  "url": "http://....."
                  ...
              },
              {
                  "url": "http://....."
                  ...
              }
          ]
      }
  }
  </code></pre>
  
  <p>I want to write a custom deserializer for both <code>user</code> and <code>photos</code>. </p>
  
  <p>so I have:</p>
  
  <pre><code>public class User {
      private long id;
      private ArrayList&lt;Photo&gt; photos;
      ... 
  
      public static class Deserializer implements JsonDeserializer&lt;User&gt; {
          ... // does the custom serialization of the User object 
      }  
  }
  
  public class Photo {
      private String url;
      ... 
  
      public static class Deserializer implements JsonDeserializer&lt;Photos&gt; {
          ... // does the custom serialization of the Photo object 
      }  
  }
  </code></pre>
  
  <p>and when initializing I do this:</p>
  
  <pre><code>new GsonBuilder()
     .registerTypeAdapter(User.class, new User.Deserializer());
     .registerTypeAdapter(Photos.class, new Photos.Deserializer());
  </code></pre>
  
  <p>However, when i deserialize the <code>User</code> class, it hits the <code>User</code>'s deserializer but never hits the <code>Photo</code>'s deserializer. But if i get a json with the photo object not nested in the user json object like this:</p>
  
  <pre><code>{
      "photos": [
           {
               "url": "http://....."
                ...
           },
           {
               "url": "http://....."
                ...
           },
           {
               "url": "http://....."
                ...
           }
  ]
  </code></pre>
  
  <p>it will properly hit the <code>Photo</code>'s deserializer</p>