Closed bbprojectnet closed 5 years ago
I found same issue here: https://github.com/cloudcreativity/laravel-json-api/issues/335 Sorry for a duplicate.
Ah no problem. The work around for the moment is to add the validation rules, as described in that issue. I'll fix it for 2.0
as it'll require some interface changes.
As this is a duplicate issue, I'll close this one.
Let's consider that PATCH request:
...everything is fine, record is updated with relationship groups.
But, if we make a mistake and forget array in
relationships.groups.data
:we get error:
Expecting relationship to have a data member that is an array. at (...)\vendor\cloudcreativity\laravel-json-api\src\Adapter\AbstractRelationshipAdapter.php:77
I write some validator rules to avoid this but i think this should by validated by library itselfy, like other things, eg.: ID as string, data as object, non existing relation object etc.
Btw. Great library! Good job! :)