TypedJSON icon indicating copy to clipboard operation
TypedJSON copied to clipboard

object references not preserved

Open JohnWeisz opened this issue 9 years ago • 1 comments

Currently, serializing then deserializing an object where multiple properties reference the same object will yield separate objects:

@JsonObject
class Person { }

@JsonObject
class Company {
    @JsonMember boss: Person;
    @JsonMember owner: Person;
}

var company = new Company();
company.boss = company.owner = new Person();
var ripoff = TypedJSON.parse(TypedJSON.stringify(company), Company);

ripoff.boss === ripoff.owner; // false

This feature is planned to be supported in the future.

JohnWeisz avatar Apr 26 '16 10:04 JohnWeisz

Are there any updates on this?

puchm avatar Nov 22 '22 09:11 puchm