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

Support client-generated IDs when creating resources

Open tobyzerner opened this issue 7 years ago • 2 comments

As per https://jsonapi.org/format/#crud-creating-client-ids

tobyzerner avatar Dec 14 '18 02:12 tobyzerner

setId method added to AdapterInterface in 0.2, though this is not yet used

tobyzerner avatar Aug 26 '21 23:08 tobyzerner

Likely API:

class FooResource
{
    public function id()
    {
        return Id::make()
            ->get(...)
            ->allowClientGenerated()
            ->default(...)
            ->set(...)
            ->validate(...)
    }
}

tobyzerner avatar Aug 29 '21 04:08 tobyzerner