api-components-bundle
api-components-bundle copied to clipboard
Collection data transformer should use sub-request.
Should probably use a sub-request for collections instead of current functionality. E.g.
function getCollection() {
$subRequest = Request::create($path, $method, [], [], [], [], $body);
try {
return $this->kernel->handle($subRequest, HttpKernelInterface::SUB_REQUEST);
} catch (\Exception $e) {
// handle
}
}
There is a potential issue with this, relating to the security that may be in place when fetching the collection via the API. The collection component could possibly be better off using its current method to bypass this API security... but then again, should a collection be retrievable within this component if it is not accessible via the API?... It could be desirable.