From 3443bbd8d8ee0bc7d64438b9bc84d8fff4d2e132 Mon Sep 17 00:00:00 2001 From: roadiz-ci Date: Wed, 10 Apr 2024 09:57:25 +0000 Subject: [PATCH] fix: Allow OpenApi decoration with no `web_response_by_path` path --- src/Api/OpenApi/WebResponseDecorator.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Api/OpenApi/WebResponseDecorator.php b/src/Api/OpenApi/WebResponseDecorator.php index da54e849..21131a1e 100644 --- a/src/Api/OpenApi/WebResponseDecorator.php +++ b/src/Api/OpenApi/WebResponseDecorator.php @@ -22,6 +22,10 @@ public function __invoke(array $context = []): OpenApi { $openApi = ($this->decorated)($context); $pathItem = $openApi->getPaths()->getPath('/api/web_response_by_path'); + if (null === $pathItem) { + return $openApi; + } + $operation = $pathItem->getGet(); $openApi->getPaths()->addPath('/api/web_response_by_path', $pathItem->withGet(