diff --git a/src/Core/Upgrade/UpgradeApiResourceVisitor.php b/src/Core/Upgrade/UpgradeApiResourceVisitor.php index ead9a207f01..ab50460824b 100644 --- a/src/Core/Upgrade/UpgradeApiResourceVisitor.php +++ b/src/Core/Upgrade/UpgradeApiResourceVisitor.php @@ -130,8 +130,8 @@ public function enterNode(Node $node) $arguments = []; $operations = null === $this->resourceAnnotation->itemOperations && null === $this->resourceAnnotation->collectionOperations ? null : array_merge( - $this->legacyOperationsToOperations($this->getLegacyOperations()), - $this->legacyOperationsToOperations($this->getLegacyOperations(true), true) + $this->legacyOperationsToOperations($this->getLegacyOperations(true), true), + $this->legacyOperationsToOperations($this->getLegacyOperations()) ); if (null !== $operations) { @@ -443,6 +443,9 @@ private function legacyOperationsToOperations($legacyOperations, bool $isCollect $method = $operation['method'] ?? strtoupper($operationName); unset($operation['method']); + if(!in_array($operationName, ['get', 'post', 'put', 'patch', 'delete'])) { + $operation['name']= $operationName; + } $operations[] = $this->createOperation($this->getOperationNamespace($method, $isCollection), $operation); }