holidayextras / jsonapi-client

Easily consume a json:api service in Javascript.
MIT License
68 stars 19 forks source link

Remove resource id in POST request instead of send the null value #36

Closed danielebriggi closed 8 years ago

danielebriggi commented 8 years ago

When is created a resource for POST purpose, the id attribute is initialised to null.

In the jsonapi.org specifications is not specified that the id must not be present in case of server-generated id but should not be better to avoid to send id set to null by default in POST request and do not send it all?

In my case the PHP lib that I use https://github.com/cloudcreativity/json-api doesn't expect by default the id attribute when the id is not generated client-side. If present (even if null) but not expected the validation fails. I think that it's the right choice, it should not be set.

theninj4 commented 8 years ago

Fixed in v0.7.0