Closed legendik closed 6 years ago
@legendik how can the error be reproduced? In fact, the constructor calls the methods "parseUriPath" and "parseUriQuery", which set all the required values.
@pmarien
$relationship = new \Enm\JsonApi\Model\Resource\Relationship\Relationship('signatures');
$jsonResource = new \Enm\JsonApi\Model\Resource\JsonResource('configs', '7', ['some' => 'data']);
$jsonResource->relationships()->set($relationship);
$document = new \Enm\JsonApi\Model\Document\Document($jsonResource);
$request = new \Enm\JsonApi\Model\Request\Request(
'GET',
new \GuzzleHttp\Psr7\Uri('http://server/v1/configs/7'),
$document,
'v1'
);
var_dump($request->createSubRequest('signatures'));
If url contains ?include=foo
, the problem is gone, because of these lines: https://github.com/eosnewmedia/JSON-API-Common/blob/master/src/Model/Request/Request.php#L202-L205
Otherwise Request::currentLevelIncludes
stays null
, because $includes
is empty and the error is thrown.
ok, thanks! i have merged the pull request and tagged it as 3.1.3
Thanks! 🎉
Without this fix it triggers errors like.
in_array() expects parameter 2 to be array, null given