title: Spring Post Controller not Serializing JSON Request to Java Object
body: <p>So I have this controller: 
  <br></p>
  
  <pre><code>@RequestMapping(value = "/zone/settings/ranged/update", method = RequestMethod.POST, produces="application/json", consumes="application/json")
  public @ResponseBody ResponseEntity&lt;Map&lt;String, Object&gt;&gt; zoneSettingsRangedUpdate(
          WebRequest request,
          @RequestBody RoundRangeData data,
          Map&lt;String, Object&gt; model
  ) throws IOException {
      model.put("request", data);
      model.put("success",true);
  
      return new ResponseEntity&lt;&gt;(model, HttpStatus.OK);
  }
  </code></pre>
  
  <p><br>
  With this as the POJO: 
  <br></p>
  
  <pre><code>public class RoundRangeData {
      private BigInteger pricingDate;
      private Long zoneid;
      private Long psid;
      private Float roundTo;
      private Float lowerLimit;
      private Float upperLimit;
  
  public RoundRangeData() {
  
  }
  
  public RoundRangeData(BigInteger pricingDate, Long zoneid, Long psid, Float roundTo, Float lowerLimit, Float upperLimit) {
      this.pricingDate = pricingDate;
      this.zoneid = zoneid;
      this.psid = psid;
      this.roundTo = roundTo;
      this.lowerLimit = lowerLimit;
      this.upperLimit = upperLimit;
  }
  
  public BigInteger getPricingDate() {
      return pricingDate;
  }
  
  public void setPricingDate(BigInteger pricingDate) {
      this.pricingDate = pricingDate;
  }
  
  public Long getZoneid() {
      return zoneid;
  }
  
  public void setZoneid(Long zoneId) {
      this.zoneid = zoneId;
  }
  
  public Long getPsid() {
      return psid;
  }
  
  public void setPsid(Long psid) {
      this.psid = psid;
  }
  
  public Float getRoundTo() {
      return roundTo;
  }
  
  public void setRoundTo(Float roundTo) {
      this.roundTo = roundTo;
  }
  
  public Float getLowerLimit() {
      return lowerLimit;
  }
  
  public void setLowerLimit(Float lowerLimit) {
      this.lowerLimit = lowerLimit;
  }
  
  public Float getUpperLimit() {
      return upperLimit;
  }
  
  public void setUpperLimit(Float upperLimit) {
      this.upperLimit = upperLimit;
  }
  }
  </code></pre>
  
  <p>Using this request (Chrome devtools screenshot, actual request has quotes around properties): </p>
  
  <p><a href="https://i.stack.imgur.com/QuAUU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QuAUU.png" alt="enter image description here"></a></p>
  
  <p>And I keep getting this error: </p>
  
  <blockquote>
    <p>WARNING:  Failed to write HTTP message: org.springframework.http.converter.HttpMessageNotWritableException: Could not write content:  <strong>No serializer found</strong> for class org.springframework.validation.DefaultMessageCodesResolver and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS)  (through reference chain: org.springframework.validation.support.BindingAwareModelMap["org.springframework.validation.BindingResult.roundRangeData"]->org.springframework.validation.BeanPropertyBindingResult["messageCodesResolver"]); nested exception is com.fasterxml.jackson.databind.JsonMappingException: No serializer found for class org.springframework.validation.DefaultMessageCodesResolver and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS)  (through reference chain: org.springframework.validation.support.BindingAwareModelMap["org.springframework.validation.BindingResult.roundRangeData"]->org.springframework.validation.BeanPropertyBindingResult["messageCodesResolver"])</p>
  </blockquote>
  
  <p>What I have tried: </p>
  
  <ul>
  <li>Changed field accessors to public </li>
  <li>Tried digesting a normal string, same error </li>
  <li>Annotated each getter with @JSONProperty</li>
  <li>Created a unit test and called the controller using generated JSON
  from object mapper from an instance of the RoundRangeData Object </li>
  </ul>
  
  <p>Serializing Java objects into JSON works for responses, but I'm having 
  no luck serializing JSON into Java objects in my controllers. </p>