From db1241c66a08d226f57d8d61e0ec519071c6afdb Mon Sep 17 00:00:00 2001 From: Benjamin ROTHAN Date: Fri, 30 Aug 2024 10:06:28 +0200 Subject: [PATCH] feat(openapi): make open_api_override_responses act on default 404 response generation (#6551) --- src/OpenApi/Factory/OpenApiFactory.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OpenApi/Factory/OpenApiFactory.php b/src/OpenApi/Factory/OpenApiFactory.php index 993ca34fcb9..a41a82fb75a 100644 --- a/src/OpenApi/Factory/OpenApiFactory.php +++ b/src/OpenApi/Factory/OpenApiFactory.php @@ -374,7 +374,7 @@ private function collectPaths(ApiResource $resource, ResourceMetadataCollection } } - if (!$operation instanceof CollectionOperationInterface && 'POST' !== $operation->getMethod()) { + if (true === $overrideResponses && !$operation instanceof CollectionOperationInterface && 'POST' !== $operation->getMethod()) { if (!isset($existingResponses[404])) { $openapiOperation = $openapiOperation->withResponse(404, new Response('Resource not found')); }