I have two JSON documents which represent the same hierarchy structure and content. The only difference that I can see between the two documents is that the ordering of key value pairs are different. One document parses as I expect and the other doesn't.
I am using "Preserve References Handling" so a node should reference its parent. (The variable "hierarchyTwoNode" in the test is the document that is not having its Parent property set). I have included a test (can be found here) to demonstrate this. Here is a simplified version of the working JSON:
{
"Root": {
"$id": "1",
"Id": "1472459628771017730",
"Type": "cras",
"Content": {
"Name": "lorem"
},
"Parent": null,
"Children": [
{
"$id": "2",
"Id": "1472459628812960771",
"Type": "morbi",
"Content": {
"Name": "ipsum dolor"
},
"Parent": {
"$ref": "1"
}
}
]
}
}
And the failing JSON:
{
"Root": {
"Parent": null,
"$id": "1",
"Children": [
{
"Parent": {
"$ref": "1"
},
"$id": "2",
"Content": {
"Name": "ipsum dolor"
},
"Type": "morbi",
"Id": "1472459628812960771"
}
],
"Content": {
"Name": "lorem"
},
"Type": "cras",
"Id": "1472459628771017730"
}
}
Could someone give me an idea about what is happening?