title: How can I Serialize/De-serialize a Boolean Value from FasterXML\Jackson as an Int?
body: <p>I'm writing a JSON Client for a Server that returns <em>Boolean</em> values as "0" and "1".  When I try to run my JSON Client I currently get the following Exception:</p>
  
  <pre><code>HttpMessageNotReadableException: Could not read JSON: Can not construct instance of java.lang.Boolean from String value '0': only "true" or "false" recognized
  </code></pre>
  
  <p>So how can I setup <strong>FasterXML\Jackson</strong> to correctly parse something like:  </p>
  
  <pre class="lang-json prettyprint-override"><code>{
     "SomeServerType" : {
       "ID" : "12345",
       "ThisIsABoolean" : "0",
       "ThisIsABooleanToo" : "1"
     }
  }
  </code></pre>
  
  <p><strong>Sample Pojo's:</strong></p>
  
  <pre><code>@JsonInclude(JsonInclude.Include.NON_NULL)
  @JsonPropertyOrder({"someServerType"})
  public class myPojo
  {
     @JsonProperty("someServerType")
     SomeServerType someServerType;
  
     @JsonProperty("someServerType")
     public SomeServerType getSomeServerType() { return someServerType; }
  
     @JsonProperty("someServertype")
     public void setSomeServerType(SomeServerType type)
     { someServerType = type; }
  }
  </code></pre>
  
  <hr>
  
  <pre><code>@JsonInclude(JsonInclude.Include.NON_NULL)
  @JsonPropertyOrder({"someServerType"})
  public class SomeServerType 
  {
     @JsonProperty("ID")
     Integer ID;
  
     @JsonProperty("ThisIsABoolean")
     Boolean bool;
  
     @JsonProperty("ThisIsABooleanToo")
     Boolean boolToo;
  
     @JsonProperty("ID")
     public Integer getID() { return ID; }
  
     @JsonProperty("ID")
     public void setID(Integer id)
     { ID = id; }
  
     @JsonProperty("ThisIsABoolean")
     public Boolean getThisIsABoolean() { return bool; }
  
     @JsonProperty("ThisIsABoolean")
     public void setThisIsABoolean(Boolean b) { bool = b; }
  
     @JsonProperty("ThisIsABooleanToo")
     public Boolean getThisIsABooleanToo() { return boolToo; }
  
     @JsonProperty("ThisIsABooleanToo")
     public void setThisIsABooleanToo(Boolean b) { boolToo = b; }
  }
  </code></pre>
  
  <p><strong>Rest Client Line</strong><br>
  <em>Note 1:</em> This is using Spring 3.2<br>
  <em>Note 2:</em> toJSONString() - is a helper method that uses Jackson to Serialize my Parameters Object<br>
  <em>Note 3:</em> The Exception happens on <em>Reading IN</em> the result object</p>
  
  <pre><code>DocInfoResponse result = restTemplate.getForObject(docInfoURI.toString()
                                    + "/?input={input}",
                                    DocInfoResponse.class,
                                    toJSONString(params));
  </code></pre>