Skip to content

Commit

Permalink
feat(openapi): make open_api_override_responses act on default 404 re…
Browse files Browse the repository at this point in the history
…sponse generation (#6551)
  • Loading branch information
monitaurus authored Aug 30, 2024
1 parent 2aeafd6 commit db1241c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/OpenApi/Factory/OpenApiFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
}
Expand Down

0 comments on commit db1241c

Please sign in to comment.