title: Iterate through JSON response when the struct is not known
body: <p>I have a http server and I would like to handle JSON responses to overwrite a JSON file, and I want to be able to parse any amount of data and structure.</p>
  
  <p>So my JSON data could look like this:</p>
  
  <pre><code>{
    "property1": "value",
    "properties": {
      "property1": 1,
      "property2": "value"
    }
  }
  </code></pre>
  
  <p>Or it can look like this:</p>
  
  <pre><code>{"property": "value"}
  </code></pre>
  
  <p>I would like to iterate through each property, and if it already exists in the JSON file, overwrite it's value, otherwise append it to the JSON file.</p>
  
  <p>I have tried using <code>map</code> but it doesn't seem to support indexing. I can search for specific properties by using <code>map["property"]</code> but the idea is that I don't know any of the JSON data yet.</p>
  
  <p><strong>How can I (without knowing the struct) iterate through each property and print both its property name and value?</strong></p>