title: cannot encode json.decoded request body
body: <p>I have a server implementation. Now I am writing unit test to check it's functionalities. 
  I cannot prepare request, that would unmarshall on the server side well. Code below results with InvalidUnmarshallError. I don't know, how to debug it further.</p>
  
  <p>Client side code:</p>
  
  <pre><code>    body := PatchCatRequest{Adopted: true}
      bodyBuf := &amp;bytes.Buffer{}
      err := json.NewEncoder(bodyBuf).Encode(body)
      assert.NoError(t, err)
      req, err := http.NewRequest("PATCH", URL+"/"+catId, bodyBuf)
      recorder := httptest.NewRecorder()
      handler.PatchCat(recorder, req.WithContext(ctx))
  </code></pre>
  
  <p>Server side code:</p>
  
  <pre><code>type PatchCatRequest struct {
  Adopted bool `json:"adopted"`
  }
  
  func (h *Handler) PatchCat (rw http.ResponseWriter, req *http.Request) {
      var patchRequest *PatchCatRequest
  
  
  if err := json.NewDecoder(req.Body).Decode(patchRequest); err != nil {
      rw.WriteHeader(http.StatusBadRequest)
      logger.WithField("error", err.Error()).Error(ErrDocodeRequest.Error())
      return
  }
  ...
  }
  </code></pre>