when referring to compound documents the spec states:
In a single document, you can think of the type and id as a composite key that uniquely references resource objects in another part of the document
And when referring to resource identifiers it says:
Within a given API, each resource object’s type and id pair MUST
identify a single, unique resource.
To me this implies that the same
id can be present multiple times, provided that each time it appears it is associated with a different
However, elsewhere the spec states that a client-generated ID must be universally unique. Why does a client have to generate a universally unique
id yet a server generated
id only needs to be unique within a single
The background to this we’d like to upsert, but JSON API doesn’t seem to support that. So it seems we need to attempt to create a resource with a client generated ID, and if we get a
409 we need to attempt an update instead. We have an identifier that is definitely unique within the specific resource type, but we can’t guarantee that it is unique universally across our API.