-
Notifications
You must be signed in to change notification settings - Fork 890
Closed
Description
I read #480 and #482 but still have some questions.
According to this
format/index.md#creating-updating-and-deleting-resources
we can create main object and his related objects using request like:
POST /photos HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
{
"data": {
"type": "contact",
"attributes": {
"name_first": "John",
"name_last": "Doe"
},
"relationships": {
"phone_number": {
"data": [
{ "type": "phone_number", "number":"123-456" },
{ "type": "phone_number", "number":"123-457" }
]
}
}
}
}
And I expect that this request creates three objects:
one Contact with attrs { id: 1, name_first: "John", name_last: "Doe" }
two PhoneNumber with atrrs { id: 1, number: "123-456" }
and { id: 2, number: "123-457" }
Am I right?
Metadata
Metadata
Assignees
Labels
No labels