Skip to content

Commit 6eb9de9

Browse files
committed
fix(openapi): fix duplicate get path for webhooks
1 parent 79edced commit 6eb9de9

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/OpenApi/Factory/OpenApiFactory.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -254,10 +254,12 @@ private function collectPaths(ApiResource $resource, ResourceMetadataCollection
254254

255255
[$requestMimeTypes, $responseMimeTypes] = $this->getMimeTypes($operation);
256256

257-
if ($path) {
258-
$pathItem = $paths->getPath($path) ?: new PathItem();
259-
} elseif (!$pathItem) {
260-
$pathItem = new PathItem();
257+
if (null !== $pathItem) {
258+
if ($path) {
259+
$pathItem = $paths->getPath($path) ?: new PathItem();
260+
} else {
261+
$pathItem = new PathItem();
262+
}
261263
}
262264

263265
$forceSchemaCollection = $operation instanceof CollectionOperationInterface && 'GET' === $method;

0 commit comments

Comments
 (0)