Skip to content

Commit 49d3254

Browse files
CAFernandesCopilot
andauthored
Update src/Utils/OpenApiExporter.php
Co-authored-by: Copilot <[email protected]>
1 parent c81fc92 commit 49d3254

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Utils/OpenApiExporter.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,11 @@ public static function export(mixed $app, ?string $baseUrl = null): array
145145
$method = strtolower($route['method'] ?? 'get');
146146

147147
// Convert Laravel-style parameters to OpenAPI format
148-
$path = (string) preg_replace('/\:(\w+)/', '{$1}', $path);
148+
$path = preg_replace('/\:(\w+)/', '{$1}', $path);
149+
if ($path === null) {
150+
throw new \RuntimeException("Error processing path: '{$route['path']}'");
151+
}
152+
$path = (string) $path;
149153

150154
if (!isset($spec['paths'][$path])) {
151155
$spec['paths'][$path] = [];

0 commit comments

Comments
 (0)