Skip to content

Commit 3c4d54a

Browse files
committed
fix Laravel
1 parent 70f0bec commit 3c4d54a

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/JsonLd/Serializer/ItemNormalizer.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
use ApiPlatform\JsonLd\AnonymousContextBuilderInterface;
1717
use ApiPlatform\JsonLd\ContextBuilderInterface;
18+
use ApiPlatform\Metadata\ErrorResourceInterface;
1819
use ApiPlatform\Metadata\Exception\ItemNotFoundException;
1920
use ApiPlatform\Metadata\HttpOperation;
2021
use ApiPlatform\Metadata\IriConverterInterface;
@@ -162,7 +163,7 @@ public function normalize(mixed $data, ?string $format = null, array $context =
162163
$operation = $this->resourceMetadataCollectionFactory->create($resourceClass)->getOperation();
163164
}
164165

165-
if ($isResourceClass) {
166+
if ($isResourceClass && !is_a($resourceClass, ErrorResourceInterface::class, true)) {
166167
$resourceMetadata = $this->resourceMetadataCollectionFactory->create($resourceClass)[0];
167168
$hydraOperations = $this->getHydraOperations(false, $resourceMetadata);
168169
if (!empty($hydraOperations)) {

0 commit comments

Comments
 (0)