A quick question about the JSON API "type" response key answer matching the Ember model name.
If I have a model, say "models / photos.js" and I have a route like "/ photos", my JSON API response looks like this:
{
data: [{
id: "298486374",
type: "photos",
attributes: {
name: "photo_name_1.png",
description: "A photo!"
}
},{
id: "298434523",
type: "photos",
attributes: {
name: "photo_name_2.png",
description: "Another photo!"
}
}]
}
I believe my model name should be singular, but this error appears
Assertion Failed: You tried to push data with a type 'photos' but no model could be found with that name
This, of course, is because my model is called "photo"
Now, there is a note in the JSON API specification that states: "This specification is independent of inflection rules, so the type value can be multiple or singular. However, the same value must be used consistently throughout the implementation."
So,
tl; dr " " -, , "" JSON API, ? , ?