Skip to content

Commit

Permalink
Update swaggerResources
Browse files Browse the repository at this point in the history
  • Loading branch information
tw2066 committed Nov 21, 2024
1 parent 13eb247 commit e63b391
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/Swagger/SwaggerUiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,16 @@ public function knife4j()

public function swaggerResources()
{
return [
[
'name' => 'api-docs',
'url' => BootAppRouteListener::$httpServerName . '.' . $this->swaggerConfig->getFormat(),
// "swaggerVersion" => "",
// "location" => ""
],
];
$serverNameAll = array_reverse($this->swaggerOpenApi->serverNameAll);
$urls = [];
foreach ($serverNameAll as $serverName) {
$urls[] = [
'name' => "{$serverName} server",
'url' => $serverName . '.' . $this->swaggerConfig->getFormat(),
];
}

return $urls;
}

public function knife4jFile(string $file): PsrResponseInterface
Expand Down

0 comments on commit e63b391

Please sign in to comment.