File tree Expand file tree Collapse file tree 1 file changed +4
-9
lines changed
src/Metadata/Resource/Factory Expand file tree Collapse file tree 1 file changed +4
-9
lines changed Original file line number Diff line number Diff line change 1414namespace ApiPlatform \Metadata \Resource \Factory ;
1515
1616use ApiPlatform \Metadata \ApiResource ;
17- use ApiPlatform \Metadata \CollectionOperationInterface ;
18- use ApiPlatform \Metadata \GraphQl \Operation as GraphQlOperation ;
17+ use ApiPlatform \Metadata \Get ;
1918use ApiPlatform \Metadata \HttpOperation ;
2019use ApiPlatform \Metadata \NotExposed ;
21- use ApiPlatform \Metadata \Operations ;
2220use ApiPlatform \Metadata \Resource \ResourceMetadataCollection ;
2321use 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 || ($ operation ->getExtraProperties ()['is_legacy_resource_metadata ' ] ?? false )) {
62+ return $ resourceMetadataCollection ;
63+ }
6964 }
7065 }
7166
You can’t perform that action at this time.
0 commit comments