From feaafc3a660ca291d5ec0062cc8333599074a039 Mon Sep 17 00:00:00 2001 From: Vincent Chalamon <407859+vincentchalamon@users.noreply.github.com> Date: Wed, 4 Oct 2023 10:56:29 +0200 Subject: [PATCH] fix: entrypoint for OpenAPI --- src/Action/EntrypointAction.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Action/EntrypointAction.php b/src/Action/EntrypointAction.php index ad49c747b03..106e112cb6c 100644 --- a/src/Action/EntrypointAction.php +++ b/src/Action/EntrypointAction.php @@ -45,6 +45,10 @@ public function __invoke(Request $request = null) $context = ['request' => $request]; $operation = new Get(outputFormats: $this->documentationFormats, read: true, serialize: true, class: Entrypoint::class, provider: fn () => new Entrypoint($this->resourceNameCollectionFactory->create())); $body = $this->provider->provide($operation, [], $context); + // see https://github.com/api-platform/core/issues/5845#issuecomment-1732400657 + if ($request && ($apiOperation = $request->attributes->get('_api_operation'))) { + $operation = $apiOperation; + } return $this->processor->process($body, $operation, [], $context); }