JSONAPI format

Quang Nguyen
Sep 3, 2018 · 1 min read

I got this error recently, working with Ember Data:

Assertion Failed: normalizeResponse must return a valid JSON API document: * One or more of the following keys must be present: “data”, “errors”, “meta”.

This error happens because the JSON you are returning isn’t a JSONAPI format. Since by default, Ember Data comes with a JSONAPI serializer, we have follow the JSONAPI format, which needs to have at least one the three mentioned keys within your requested data.

{ 
“data”:
{
your-data
},
“errors”:
{
your-data
},
“meta”:
{
your-data
}
}

This could be applicable to any frameworks you use. So beware and keep your eyes out while coding!

quangtn0018

Just my findings and techniques that I’ve learned from working and doing side projects on all things software engineering related

Quang Nguyen

Written by

Software Engineer

quangtn0018

Just my findings and techniques that I’ve learned from working and doing side projects on all things software engineering related

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade