I quickly solved it this way as any exception gets turned in to an error in my code
I extended Tobscure\JsonApi\Document and overwrote the toArray() function
public function toArray()
{
// The members data and errors MUST NOT coexist in the same document.
if (!empty($this->errors)) {
$this->data = null;
$this->links = null;
}
return parent::toArray();
}
The members data and errors MUST NOT coexist in the same document. see http://jsonapi.org/format/#document-top-level
I quickly solved it this way as any exception gets turned in to an error in my code
I extended
Tobscure\JsonApi\Document
and overwrote the toArray() functionIdeally this gets combined with #130