Deserialize Json with object references
<p>Is there a way to deserialize a JSON that includes references to objects that already exist inside it using typescript?</p>

<p>For example we have a grand parent "Papa" that is associated with two parents "Dad" and "Mom" that they have together two children, the json looks like:</p>

<pre><code>{
  "id_": 1,
  "name": "Papa",
  "parents": [
    {
      "@class": "com.doubleip.spot.mgmt.test.domain.model.Parent",
      "id_": 1,
      "name": "Dad",
      "children": [
        {
          "@class": "com.doubleip.spot.mgmt.test.domain.model.Child",
          "id_": 1,
          "name": "Bob"
        },
        {
          "@class": "com.doubleip.spot.mgmt.test.domain.model.Child",
          "id_": 2,
          "name": "Trudy"
        }
      ]
    },
    {
      "@class": "com.doubleip.spot.mgmt.test.domain.model.Parent",
      "id_": 2,
      "name": "Mom",
      "children": [
        1,
        2
      ]
    }
  ]
}
</code></pre>

<p>You may see that the children of Mom are just inserted as the value of their "id_" field. This happens due to JsonIdentityInfo used in Java and fasterxml library.</p>

<p>So we face problem in front-end deserialisation where we use typescript angular and primeng in order to visualise our data.</p>