title: Converting associative array request parameters to JSON with Jackson
body: <p>I am the recipient of a webhook POST that looks like this, which I have decoded for readability.</p>
  
  <pre><code>id=12345&amp;event=this_event&amp;payload[customer][name]=ABC Company&amp;payload[customer][city]=New York&amp;payload[service][name]=New Customer&amp;payload[service][action]=New
  </code></pre>
  
  <p>Using Spring MVC, I can easily get this into a <code>Map&lt;String, Sting&gt;</code> that looks like this</p>
  
  <pre><code>{id=97659204, event=test, payload[customer][name]=ABC Company, payload[customer][city]=New York, payload[service][name]=New Customer, payload[service][action]=New}
  </code></pre>
  
  <p>I need to parse every parameter (or Map key) that starts with "payload" into a JSON object.</p>
  
  <p>My desired output from parsing the request parameters that start with "payload" would look something like this</p>
  
  <pre><code>{
      customer :  {
          name : "ABC Company",
          city : "New York"
      },
      service : {
          name : "New Customer",
          action : "New"
      }
  }
  </code></pre>
  
  <p>With the final state being a call to Jackson's ObjectMapper to turn that JSON into a POJO.</p>
  
  <p>Since I have no control over the data format begin sent to me, what is the best/correct option for parsing those request parameters into a JSON object?</p>
  
  <p>Thanks.</p>