After receiving the User object:
{
"id": "123",
"username": "TestUser",
"group":
{
"id": "324",
"name": "My Group"
}
}
I am interested in executing: normalize(user);
Is it possible to achieve this result? I want to separate the group from the user and store it as a different entity.
{
result: "123",
entities: {
"users": {
"123": {
id: "123",
group: "1",
username: "TestUser
}
},
"groups": {
"1": { "id": "324", "name": "My Group" },
}
}
}
I need help defining the schemas for this desired outcome.