title: Flattening nested attributes in Jackson
body: <p>I have the need of defining a flat POJO that maps its (flat) attributes to a nested object in its JSON specification. Better explain with code</p>
  
  <pre><code>{
      "offset": 0,
      "pageSize": 10,
      "filter": {
          "key1":"value1",
          "key2": true,
          ....
      }
  }
  </code></pre>
  
  <p>My POJO shall look like the following:</p>
  
  <pre><code>public class Pojo {
      private int offset;
      private int pageSize;
  
      private String key1;
      private boolean key2;
  }
  </code></pre>
  
  <p>So far I have tried annotating those <code>key</code> properties with <code>@JsonProperty</code> with its <code>value</code> attribute</p>
  
  <pre><code>@JsonProperty("filter.key1")
  private String key1;
  </code></pre>
  
  <p>But when I went into the MVC controller those properties, though set in JSON, were null in the decoded POJO.</p>
  
  <p>How can I fix this? What did I do wrong?</p>
  
  <p>I absolutely don't want to create nested subclasses</p>