Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bundle doesn't work with batch/subrequests #61

Open
sboesch opened this issue Mar 31, 2020 · 0 comments
Open

Bundle doesn't work with batch/subrequests #61

sboesch opened this issue Mar 31, 2020 · 0 comments

Comments

@sboesch
Copy link

sboesch commented Mar 31, 2020

We wanted to create a /batch route by using the HttpKernel:

foreach($requests as $request) {
    // ...
    $req = Request::create(
        $request['relative_url'],
        $request['method'],
        $options
    );
    $response = $kernel->handle($req);
}

However, since the ResourceCollection service (and probably others like JsonApi) sets the request on construction, it doesn't work with follow up requests:

/**
 * ResourceCollection constructor.
 */
public function __construct(RequestStack $requestStack, FinderCollection $finderCollection, Paginator $paginator, FieldManager $fieldManager)
{
    $this->request = $requestStack->getCurrentRequest();
    // ...
}

It will handle the same request over and over again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant