title: How to return request body in a field in response using Wiremock
body: <p>I have a JSON request as below:</p>
  <pre><code>{
      &quot;fieldOne&quot;: 12345,
      &quot;fieldTwo&quot;: 1234,
      &quot;fieldThree&quot;: &quot;2019-12-05T12:32:42.323905&quot;,
      &quot;fieldFour&quot;: &quot;string&quot;,
      &quot;fieldFive&quot;: 5432,
      &quot;fieldSix&quot;: &quot;string&quot;,
      &quot;fieldSeven&quot;: &quot;string&quot;,
      &quot;fieldEight&quot;: &quot;string&quot;
  }
  </code></pre>
  <p>I need to send the complete request JSON object inside a field in response. My Wiremock stub JSON is,</p>
  <pre><code>{
    &quot;request&quot;: {
      &quot;method&quot;: &quot;POST&quot;,
      &quot;urlPath&quot;: &quot;/endpoint&quot;
  },
    &quot;response&quot;: {
      &quot;status&quot;: 200,
      &quot;jsonBody&quot;: {
        &quot;request&quot;: &quot;{{{request.body}}}&quot;, //If I remove quotes here then I get error so I added the quotes
        &quot;anotherField&quot;: &quot;string&quot;
      },
      &quot;headers&quot;: {
        &quot;Content-Type&quot;: &quot;application/json;charset=UTF-8&quot;
      },
      &quot;transformers&quot;: [&quot;response-template&quot;]
    }
  }
  </code></pre>
  <p>How can I send request body in a field in response?.</p>
  <p>I now get error:</p>
  <pre><code>    Illegal unquoted character ((CTRL-CHAR, code 10)): 
  has to be escaped using backslash to be included in string value\n at [Source: (
  </code></pre>
  <h1>Edit:-</h1>
  <p>I was using wiremock <code>2.19.0</code> version which is causing this issue. I upgraded the version to <code>2.21.0</code> and now the issue is resolved</p>
  <p>But in the response I still have the below problem where the request body is within double quotes which is an invalid JSON. Response:-</p>
  <pre><code>{
      &quot;request&quot;: &quot;{ //Here the double quotes should not be present before curly brace
          &quot;fieldOne&quot;: 12345,
          &quot;fieldTwo&quot;: 1234,
          &quot;fieldThree&quot;: &quot;2019-12-05T12:32:42.323905&quot;,
          &quot;fieldFour&quot;: &quot;string&quot;,
          &quot;fieldFive&quot;: 5432,
          &quot;fieldSix&quot;: &quot;string&quot;,
          &quot;fieldSeven&quot;: &quot;string&quot;,
          &quot;fieldEight&quot;: &quot;string&quot;
      }&quot;,
      &quot;anotherField&quot;: &quot;string&quot;
  }
  </code></pre>