Skip to content

Commit 8b85397

Browse files
authored
Merge pull request #6 from Nicofuma/fix/symfony-19749
Workaround for symfony/symfony#19749
2 parents 988b1d7 + 0cc89c4 commit 8b85397

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

src/EventListener/ValidatorListener.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ public function __construct(ValidatorMap $map)
2828
*/
2929
public function onKernelRequest(GetResponseEvent $event)
3030
{
31+
// Workaround for https://github.com/symfony/symfony/issues/19749
32+
if (!$event->isMasterRequest()) {
33+
return;
34+
}
35+
3136
try {
3237
$request = $event->getRequest();
3338
$validator = $this->map->getValidator($request);

src/FosRest/ParamFetcher.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,14 @@ public function setController($controller)
4141
{
4242
$request = $this->requestStack->getCurrentRequest();
4343

44+
// Workaround for https://github.com/symfony/symfony/issues/19749
45+
if ($this->requestStack->getMasterRequest() !== $request) {
46+
$this->usingSwagger = false;
47+
$this->decorated->setController($controller);
48+
49+
return;
50+
}
51+
4452
try {
4553
$this->currentValidator = $this->validatorMap->getValidator($request);
4654
$this->currentSchema = null;

0 commit comments

Comments
 (0)