title: How to create JSON object from JSON node path in C#
body: <p>I want to map JSON path properties from key-value pairs to generate the JSON object in <strong>C#</strong> where the path contains nested array index path</p>
  <p>Input:</p>
  <pre><code>Dictionary&lt;string, string&gt; properties = new Dictionary&lt;string, string&gt;();
  properties.put(&quot;id&quot;, &quot;1&quot;);
  properties.put(&quot;name&quot;, &quot;sample_name&quot;);
  properties.put(&quot;category.id&quot;, &quot;1&quot;);
  properties.put(&quot;category.name&quot;, &quot;sample&quot;);
  properties.put(&quot;tags[0].id&quot;, &quot;1&quot;);
  properties.put(&quot;tags[0].name&quot;, &quot;tag1&quot;);
  properties.put(&quot;tags[1].id&quot;, &quot;2&quot;);
  properties.put(&quot;tags[1].name&quot;, &quot;tag2&quot;);
  properties.put(&quot;status&quot;, &quot;available&quot;);
  </code></pre>
  <p>Output:</p>
  <pre><code>{
    &quot;id&quot;: 1,
    &quot;name&quot;: &quot;sample_name&quot;,
    &quot;category&quot;: {
      &quot;id&quot;: 1,
      &quot;name&quot;: &quot;sample&quot;
    },
    &quot;tags&quot;: [
      {
        &quot;id&quot;: 1,
        &quot;name&quot;: &quot;tag1&quot;
      },
      {
        &quot;id&quot;: 2,
        &quot;name&quot;: &quot;tag2&quot;
      }
    ],
   
    &quot;status&quot;: &quot;available&quot;
  }
  </code></pre>
  <p>Using <a href="https://github.com/FasterXML/jackson-dataformats-text/issues/139" rel="nofollow noreferrer">Jackson's JavaPropsMapper</a> it can easily be achieved like:</p>
  <pre><code>JavaPropsMapper javaPropsMapper = new JavaPropsMapper();
  JsonNode json = javaPropsMapper.readMapAs(properties, JsonNode.class);
  </code></pre>
  <p>How to implement this idea in <strong>C#</strong> so that I am able to generate the JSON object from the given JSON path node.</p>