Hi, I'm using JSON with Gson package for java. I have an object where there are some inner references from object in one field to object in another field. For example:
{ "loci": [ { "id": "loc1",
"length": 10000, "start": 2 },
{ "id": "loc2", "length": 100,
"start": 50000 } ], "scenarios": [ { "id": "scen1", "loci": [ { "id": "loc1", "length": 10000, "start": 2 }, { "id": "loc2", "length": 100, "start": 50000 } ] }, ] }
So I actually have only two locus objects defined in my java program (loc1 and loc2), but in the printout the objects are duplicated and appear both under "loci" and inside "scen1". Can JSON reflect that there are only two objects actually (so when I load it, it won't create four loci instead of two)?