Open cincauhangus opened 4 years ago
Good point. Looks like a missing feature.
Implemented in #108. Please take a look at v2.2.0 and let me know if that works for you.
Example: https://github.com/json-api-php/json-api/blob/master/test/NewResourceObjectTest.php
thank you, will check it out in a bit!
I've tested it out and I believe it would work for a typical insert operation. However, I realised my current code is also not per spec as well as I have multiple new resources in the data object, e.g.
{
data: [
{ /*new resource*/ },
{ /*new resource*/ }
]
}
I believe the correct method is to adopt the atomic extension. Do you have plans to support this extension?
No such plans, but PRs are always welcomed. (I know, I'm super fast with my replies)
Is it possible to omit the id in ResourceObject when making a request to create a new resource? From the JSON API spec, it allows id to be omitted when creating resources.