In a document, you may want to create a resource object that doesn’t correspond to a database object, and therefore, that doesn’t have a unique id from which you can recover that data.
However, the spec states:
Within a given API, each resource object’s type and id pair MUST identify a single, unique resource.
Does that imply that we should have the ability to retrieve that resource with that id?
If we want to have document-wide ids (which therefore might have a new id if the request was to be repeated), is the current solution to generate a UUIDv4 for each of those ids?
Could we standardize a way to say, “this id is document-wide, not API-wide”, to avoid having huge ids everywhere? For instance, if the id starts with an underscore, it is document-wide, otherwise it is API-wide. It doesn’t functionally break backwards compatibility: an existing id starting with
_ that was assumed to be API-wide in v1.0 becomes a document-wide id which incidentally is the same across requests.