Answer the question
In order to leave comments, you need to log in
When I give a resource, should the user's data be written in atributes or at the same level as id and type in the JSON API?
Attention, the question is strictly on this specification: JSON API , not just JSON.
Actually, it should be like this:
{
"type": "user",
"id": "1",
"attributes": {
"name": "Dima",
"email":"[email protected]"
},
},
{
"type": "user",
"id": "1",
"name": "Dima",
"email":"[email protected]",
"attributes": {
},
},
Answer the question
In order to leave comments, you need to log in
He asked, he answered.
Still, all data must be written in attributes, i.e. first option. Here
is an example .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question