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.
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.