Skip to content

Commit db1241c

Browse files
authored
feat(openapi): make open_api_override_responses act on default 404 response generation (#6551)
1 parent 2aeafd6 commit db1241c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/OpenApi/Factory/OpenApiFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ private function collectPaths(ApiResource $resource, ResourceMetadataCollection
374374
}
375375
}
376376

377-
if (!$operation instanceof CollectionOperationInterface && 'POST' !== $operation->getMethod()) {
377+
if (true === $overrideResponses && !$operation instanceof CollectionOperationInterface && 'POST' !== $operation->getMethod()) {
378378
if (!isset($existingResponses[404])) {
379379
$openapiOperation = $openapiOperation->withResponse(404, new Response('Resource not found'));
380380
}

0 commit comments

Comments
 (0)