jsonapi-serializer freezes the browser when nested include is used
See original GitHub issuejsonapi-serializer 3.0.1
The resources I include: calendar_event, space,host.profile
new Deserializer({keyForAttribute: 'snake_case'}).deserialize(input, (err, resource) => {
console.log(resource);
onSuccess(response, resource);
});
Here is the input:
{
"data": {
"id": "524",
"type": "events",
"attributes": {
"name": "Omnis labore laboriosam magni qui.",
"status": "pending",
"cost_cents": 7577,
"description": "perferendis molestiae voluptatem",
"is_public": true,
"bartender": false
},
"relationships": {
"calendar_event": {
"data": {
"id": "424",
"type": "calendar_events"
}
},
"host": {
"data": {
"id": "1",
"type": "users"
}
},
"space": {
"data": {
"id": "1",
"type": "spaces"
}
}
}
},
"included": [
{
"id": "424",
"type": "calendar_events",
"attributes": {
"title": "Booking",
"availability": "busy",
"starts_at": "2016-03-25T06:30:00.000Z",
"ends_at": "2016-03-25T13:30:00.000Z",
"ical_schedule": null
},
"relationships": {
"resource": {
"data": {
"id": "524",
"type": "events"
}
}
}
},
{
"id": "1",
"type": "users",
"attributes": {
"email": "my@email.com",
"roles": []
},
"relationships": {
"profile": {
"data": {
"id": "1",
"type": "profiles"
}
}
}
},
{
"id": "1",
"type": "profiles",
"attributes": {
"first_name": "Anton",
"last_name": "Anton",
"birthday": "1905-12-10",
"avatar_original_url": "aha!",
"avatar_thumb_url": "aha!",
"bio": null,
"phone": "aha!",
"address_line_1": "aha!",
"address_line_2": null,
"city": "aha!",
"state": "aha!",
"postcode": "aha!",
"country_code": null
},
"relationships": {
"user": {
"data": {
"id": "1",
"type": "users"
}
}
}
},
{
"id": "1",
"type": "spaces",
"attributes": {
"name": "Space #1",
"from_people": 1,
"to_people": 10,
"picture_original_url": "aha!",
"picture_thumb_url": "aha!",
"picture_thumb_2x_url": "aha!",
"credits_per_slot": 10
}
}
]
}
Issue Analytics
- State:
- Created 7 years ago
- Comments:10 (2 by maintainers)
Top Results From Across the Web
Deep nested serialization, preferably without JSONAPI spec
Since upgrading to the latest gem version however, my deep nested associations are not rendering as json. For example, look at projects and ......
Read more >nested loop takes too long and almost crashes the browser
Since you are just looping through an array you can split that up into different parts and use timers to process each ...
Read more >@ember-data/model | Yarn - Package Manager
Fast, reliable, and secure dependency management.
Read more >Accessing relationship data with JSON: API serializer
There are two ways to display attributes for any has_many or belongs_to relationships using JSON:API serializer. Deeply nested.
Read more >JS libraries | Everything I know - My Knowledge Wiki
normalizr - Normalizes nested JSON according to a schema. FBJS - Collection of utility libraries used by other Facebook JS projects. Uppy -...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi @SeyZ I’ve dropped v3.4.3 into my project and it’s all good 😃 thanks 👍
Thanks @SeyZ!