Skip to content

Commit fe84af2

Browse files
authored
fix(symfony): allow null $data in PlaceholderAction (#8359)
Closes #8354
1 parent 43e3b4c commit fe84af2

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/Symfony/EventListener/DeserializeListener.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@ public function onKernelRequest(RequestEvent $event): void
7676
}
7777

7878
if (!$operation->canDeserialize()) {
79+
if (!$request->attributes->has('data')) {
80+
$request->attributes->set('data', null);
81+
}
82+
7983
return;
8084
}
8185

tests/Functional/JsonLd/InputOutputDtoTest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,10 +158,6 @@ public function testInputOutputCycle(): void
158158

159159
public function testCreateNoInputResource(): void
160160
{
161-
if ($_SERVER['USE_SYMFONY_LISTENERS'] ?? false) {
162-
$this->markTestSkipped('PlaceholderAction cannot resolve $data when input:false in event-listener mode.');
163-
}
164-
165161
$response = self::createClient()->request('POST', '/jsonld_no_inputs', [
166162
'headers' => ['Accept' => 'application/ld+json'],
167163
]);

0 commit comments

Comments
 (0)