api-components-bundle icon indicating copy to clipboard operation
api-components-bundle copied to clipboard

Collection data transformer should use sub-request.

Open silverbackdan opened this issue 4 years ago • 1 comments

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
        }
}

silverbackdan avatar May 11 '20 11:05 silverbackdan

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.

silverbackdan avatar Jun 05 '20 14:06 silverbackdan