Skip to content

Commit f3fdbcb

Browse files
fix: ignore non API Platform routes on SerializeListener
1 parent ecce956 commit f3fdbcb

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/Symfony/EventListener/SerializeListener.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,13 @@ public function onKernelView(ViewEvent $event): void
7575

7676
$attributes = RequestAttributesExtractor::extractAttributes($request);
7777

78-
// TODO: 3.0 remove condition
78+
// TODO: 3.0 adapt condition (remove legacy part)
7979
if (
80-
(!$this->resourceMetadataFactory || $this->resourceMetadataFactory instanceof ResourceMetadataFactoryInterface)
81-
&&
82-
(
83-
!($attributes['respond'] ?? $request->attributes->getBoolean('_api_respond', false))
84-
|| ($attributes && $this->isOperationAttributeDisabled($attributes, self::OPERATION_ATTRIBUTE_KEY))
80+
!($attributes['respond'] ?? $request->attributes->getBoolean('_api_respond', false))
81+
|| (
82+
(!$this->resourceMetadataFactory || $this->resourceMetadataFactory instanceof ResourceMetadataFactoryInterface)
83+
&& $attributes
84+
&& $this->isOperationAttributeDisabled($attributes, self::OPERATION_ATTRIBUTE_KEY)
8585
)
8686
) {
8787
return;

0 commit comments

Comments
 (0)