Not globally unique resource IDs

Looking for some advice. In my project’s api (currently non JSON:API), I conceal the primary key and instead am using a sequenced, organisation and entity scoped identifier.

Organisation 1
process/1
process/2
process/3
system/1
system/2
system/3

Organisation 2
process/1
process/2
process/3
system/1
system/2
system/3

Side note: My app will validate a resource using on the currently authenticated organisation and the entity’s identifier. The reason for this design stemmed from wanting to keep entities easily trackable for system users, the id is used for ordering records in tables and record links.

I read that:

“an object’s type and id pair MUST identify a single, unique resource.”

How could such a schema be handled?

Keep in mind that the requirement you cite is specific to the type and id values for resources; they don’t have to be reflected in the URL structure.

I have the same situation in my application, which is starting to use JSON:API as I add new endpoints. To date, I’ve just ignored the issue, since strict conformance isn’t that important right now. But when I have time to deal with it, the only place I’ll change things is in the id properties. Nothing else is required to conform to the specification.

1 Like