json-api-client icon indicating copy to clipboard operation
json-api-client copied to clipboard

Check Client-Generated IDs on creating resource

Open Art4 opened this issue 7 years ago • 2 comments
trafficstars

As stated in the spec a client-generated ID along with a request to create a rescource MUST SHOULD be an UUID.

Source: http://jsonapi.org/format/1.0/#crud-creating-client-ids

Client-Generated IDs

A server MAY accept a client-generated ID along with a request to create a resource. An ID MUST be specified with an id key, the value of which MUST be a universally unique identifier. The client SHOULD use a properly generated and formatted UUID as described in RFC 4122 [RFC4122].

The default ID checker should check for UUIDs, but it should be possible to inject a custom checker.

Art4 avatar May 24 '18 12:05 Art4

Hi, in some cases it doesn't MUST be an UUID:

NOTE: In some use-cases, such as importing data from another source, it may be possible to use something other than a UUID that is still guaranteed to be globally unique. Do not use anything other than a UUID unless you are 100% confident that the strategy you are using indeed generates globally unique identifiers.

nebur81 avatar Jun 06 '19 16:06 nebur81

@nebur81 Thanks, I've updated the issue description.

Art4 avatar Jun 07 '19 11:06 Art4