Skip to content

Commit bbba5d8

Browse files
authored
fix(metadata): add not exposed when no get (api-platform#4939)
1 parent dcbbd06 commit bbba5d8

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

src/Metadata/Resource/Factory/NotExposedOperationResourceMetadataCollectionFactory.php

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,9 @@
1414
namespace ApiPlatform\Metadata\Resource\Factory;
1515

1616
use ApiPlatform\Metadata\ApiResource;
17-
use ApiPlatform\Metadata\CollectionOperationInterface;
18-
use ApiPlatform\Metadata\GraphQl\Operation as GraphQlOperation;
17+
use ApiPlatform\Metadata\Get;
1918
use ApiPlatform\Metadata\HttpOperation;
2019
use ApiPlatform\Metadata\NotExposed;
21-
use ApiPlatform\Metadata\Operations;
2220
use ApiPlatform\Metadata\Resource\ResourceMetadataCollection;
2321
use ApiPlatform\Symfony\Routing\SkolemIriConverter;
2422

@@ -59,13 +57,10 @@ public function create(string $resourceClass): ResourceMetadataCollection
5957
$operations = $resource->getOperations();
6058

6159
foreach ($operations as $operation) {
62-
// Ignore collection and GraphQL operations
63-
if ($operation instanceof CollectionOperationInterface || $operation instanceof GraphQlOperation) {
64-
continue;
65-
}
66-
6760
// An item operation has been found, nothing to do anymore in this factory
68-
return $resourceMetadataCollection;
61+
if ($operation instanceof Get) {
62+
return $resourceMetadataCollection;
63+
}
6964
}
7065
}
7166

0 commit comments

Comments
 (0)