Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions src/Services/SwaggerService.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Illuminate\Http\Request;
use Illuminate\Http\Testing\File;
use Illuminate\Support\Arr;
use Illuminate\Support\Facades\URL;
use Illuminate\Support\Str;
use ReflectionClass;
use RonasIT\AutoDoc\Exceptions\DocFileNotExistsException;
Expand Down Expand Up @@ -140,7 +141,7 @@ protected function generateEmptyData(): array
$data = [
'openapi' => self::OPEN_API_VERSION,
'servers' => [
['url' => $this->getAppUrl() . $this->config['basePath']],
['url' => URL::query($this->config['basePath'])],
],
'paths' => [],
'components' => [
Expand All @@ -158,13 +159,6 @@ protected function generateEmptyData(): array
return $data;
}

protected function getAppUrl(): string
{
$url = config('app.url');

return str_replace(['http://', 'https://', '/'], '', $url);
}

protected function generateSecurityDefinition(): ?array
{
if (empty($this->security)) {
Expand Down
2 changes: 1 addition & 1 deletion src/Traits/GetDependenciesTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ protected function transformDependency(ReflectionParameter $parameter)
{
$type = $parameter->getType();

if (empty($type)) {
if (empty($type) || !$type instanceof \ReflectionNamedType) {
return null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"openapi": "3.1.0",
"servers": [
{
"url": "localhost/"
"url": "http://localhost"
}
],
"paths": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"openapi": "3.1.0",
"servers": [
{
"url": "localhost/"
"url": "http://localhost"
}
],
"paths": [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"openapi": "3.1.0",
"servers": [
{
"url": "localhost/"
"url": "http://localhost"
}
],
"paths": [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"openapi": "3.1.0",
"servers": [
{
"url": "localhost/"
"url": "http://localhost"
}
],
"paths": [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"openapi": "3.1.0",
"servers": [
{
"url": "localhost/"
"url": "http://localhost"
}
],
"paths": [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"openapi": "3.1.0",
"servers": [
{
"url": "localhost/"
"url": "http://localhost"
}
],
"paths": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"openapi": "3.1.0",
"servers": [
{
"url": "localhost/"
"url": "http://localhost"
}
],
"paths": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"openapi": "3.1.0",
"servers": [
{
"url": "localhost/"
"url": "http://localhost"
}
],
"paths": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"openapi": "3.1.0",
"servers": [
{
"url": "localhost/"
"url": "http://localhost"
}
],
"paths": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"openapi": "3.1.0",
"servers": [
{
"url": "localhost/"
"url": "http://localhost"
}
],
"paths": {
Expand Down
Loading