title: How can i convert python nested dictionary to json file?
body: <p>I have a python nested dictionary in the following format</p>
  <pre><code>data = {
          'item1': {
              'name': &quot;A&quot;,
              'price': 10
          },
          'item2': {
              'name': &quot;B&quot;,
              'price': 20
          }
      }
  </code></pre>
  <p>My expected output JSON file will be the following format</p>
  <pre><code>[
    {
      &quot;name&quot;: &quot;A&quot;,
      &quot;price&quot;: 10
    },
    {
      &quot;name&quot;: &quot;B&quot;,
      &quot;price&quot;: 20
    }
  ]
  </code></pre>
  <p>My code is</p>
  <pre><code>data = {
      'item1': {
          'name': &quot;A&quot;,
          'price': 10
      },
      'item2': {
          'name': &quot;B&quot;,
          'price': 20
      }
  }
  with open(&quot;my.json&quot;, &quot;w&quot;) as f:
      json.dump(data, f)
  </code></pre>
  <p>But this code can't generate my expected JSON output format, how can i do it?</p>