Relationships type


#1

Can a relationship point to different types of resources?

ie… is the following response legal?

{
“links”: {
“self”: “/house/1/relationships/owner”,
“related”: “/house/1/owner”
},
“data”: [{
“type”: “people”,
“id”: “12”
},
{
“type”:“company”,
“id”: “44”
}]
}


#2

Based on this I’d say it is legal.

A server MUST return 409 Conflict when processing a POST request in
which the resource object’s type is not among the type(s) that constitute the
collection represented by the endpoint.

Note the use of the plural: type(s)


#3

I would argue that it’s the reason for the type attribute in the first place, no?