title: Converting Nested json into dot notation json
body: <p>I have a service from where I get a json string response like as shown below</p>
  
  <pre><code>{
    "id": "123",
    "name": "John"
  }
  </code></pre>
  
  <p>I consume the rest call using HttpClient  and converts the json string to <code>Map&lt;String, String&gt;</code> like as shown below.</p>
  
  <pre><code>String url= "http://www.mocky.io/v2/5979c2f5110000f4029edc93";
  HttpClient client = HttpClientBuilder.create().build();
  HttpGet httpGet = new HttpGet(url);
  httpGet.setHeader("Content-Type", "application/json");
  HttpResponse httpresponse = client.execute(httpGet);
  String response = EntityUtils.toString(httpresponse.getEntity());
  
  ObjectMapper mapper = new ObjectMapper();
  Map&lt;String, String&gt; map = mapper.readValue(response, new TypeReference&lt;Map&lt;String, String&gt;&gt;(){});
  </code></pre>
  
  <p>The conversion from json string to <code>HashMap</code> is working fine, but actually my requirement was sometimes there can be some nested json within the main json, for example in the below json I am having an additional <code>address</code> key which is again a nested json having <code>city</code> and <code>town</code> details. </p>
  
  <pre><code>{
    "id": "123",
    "name": "John",
    "address": {
      "city": "Chennai",
      "town": "Guindy"
    }
  }
  </code></pre>
  
  <p>If any nested json comes I need the make the json like as shown below</p>
  
  <pre><code>{
    "id": "123",
    "name": "John",
    "address.city": "Chennai",
    "address.town": "Guindy"
  }
  </code></pre>
  
  <p>Currently I am using jackson library, but open to any other library which will give me this feature out of box</p>
  
  <p>Can anyone help me by giving some suggestion on this.</p>