title: Jackson: deserializing recursive object
body: <p>I'm trying to parse the filter parameters sent by a KendoUI grid to my web service and am having some issues convincing Jackson to parse this JSON. As far as I know, I can control the format of the parameters that Kendo sends, but I do not know how I would marshal the parameters into a better format so they remain unchangeable for now.</p>
  
  <p>I intend to convert these parameters into a SQL query for an Oracle database.</p>
  
  <h1>Example JSON:</h1>
  
  <pre><code>{
      "filters":
      [
          {
              "field": "Name",
              "operator": "contains",
              "value": "John"
          },
          {
              "filters": [
                  {
                      "field": "Age",
                      "operator": "gt",
                      "value": 20
                  },
                  {
                      "field": "Age",
                      "operator": "lt",
                      "value": 85
                  }
              ],
              "logic", "and"
          },
          {
              "field": "Address",
              "operator": "doesnotcontain",
              "value": "street"
          }
      ],
      "logic": "or"
  }
  </code></pre>
  
  <h1>Filters. Java</h1>
  
  <pre><code>public class Filters {
      private List&lt;Filter&gt; filters;
      private String logic;
      // accessors/mutators/toString
  }
  </code></pre>
  
  <h1>Filter.java</h1>
  
  <pre><code>public class Filter {
      private String field;
      private String operator;
      private String value;
      // accessors/mutators/toString
  }
  </code></pre>
  
  <h1>Unit Test</h1>
  
  <pre><code>public class KendoGridFilterTest {
      private ObjectMapper mapper;
  
      @Before
      public void before() {
          mapper = new ObjectMapper();
      }
  
      @Test
      public void jsonParseTest() {
          final String json = "{\"filters\":[{\"field\":\"Name\",\"operator\":\"contains\",\"value\":\"John\"},{filters: [{\"field\":\"Age\",\"operator\": \"eq\",\"value\": 85},{\"field\": \"Age\",\"operator\": \"eq\",\"value\": 85}]\"logic\", \"and\",},{\"field\": \"Address\",\"operator\": \"doesnotcontain\",\"value\": \"street\"}],\"logic\":\"or\"}";
          Filters filters = mapper.readValue(json, Filters.class);
          assertTrue(json.equals(filters.writeValueAsString(filters);
      }
  }
  </code></pre>
  
  <h1>Errors</h1>
  
  <pre>
  com.fasterxml.jackson.databind.UnrecognizedPropertyException: Unrecognized field 
      'logic'(com.example.Filter) not market as ignorable (3 known properties 
      "value", "field", "operator")
  at [Source: java.io.StringReader@3bb2b8; line: 1, column 76] (through reference 
      chain: com.example.Filters["filters"]->com.example.Filter["logic"]
  </pre>
  
  <p>I've also tried adding <code>@JsonIdentityInfo(generator=ObjectIdGenerators.IntSequenceGenerator.class, property="@id")</code> to the Filters class and get the same errors.</p>