Skip to content

Commit 42559e8

Browse files
committed
fix: scamble api docs routes do not work
1 parent 11f2734 commit 42559e8

3 files changed

Lines changed: 9 additions & 3 deletions

File tree

app/Jobs/IndexFiles.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ private function generateCategories($path) {
227227
$data = Storage::json('categories.json') ?? ['next_ID' => 1, 'categoryStructure' => []]; // array("anime"=>1,"tv"=>2,"yogscast"=>3); // read from json
228228
$scanned = array_filter(
229229
scandir($path),
230-
fn($item) => $item !== '.' &&
230+
fn ($item) => $item !== '.' &&
231231
$item !== '..' &&
232232
is_dir($path . DIRECTORY_SEPARATOR . $item)
233233
); // read folder structure
@@ -588,5 +588,4 @@ private function ResolveExistingUuid(?string $embeddedUuid, string $compositeId)
588588
];
589589
}
590590
}
591-
class BatchCancelledException extends \Exception {
592-
}
591+
class BatchCancelledException extends \Exception {}

app/Providers/AppServiceProvider.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace App\Providers;
44

55
use App\Models\User;
6+
use Dedoc\Scramble\Scramble;
67
use GuzzleHttp\Client;
78
use Illuminate\Auth\Notifications\ResetPassword;
89
use Illuminate\Support\Facades\Gate;
@@ -24,6 +25,8 @@ public function register(): void {
2425
]);
2526
});
2627
}
28+
29+
Scramble::ignoreDefaultRoutes();
2730
}
2831

2932
/**

routes/web.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use App\Http\Middleware\MetadataSSR;
66
use App\Models\Category;
77
use App\Models\Folder;
8+
use Dedoc\Scramble\Scramble;
89
use Illuminate\Support\Facades\Auth;
910
use Illuminate\Support\Facades\Gate;
1011
use Illuminate\Support\Facades\Response;
@@ -91,6 +92,9 @@
9192
]);
9293
});
9394

95+
Scramble::registerUiRoute('docs/api');
96+
Scramble::registerJsonSpecificationRoute('docs/api.json');
97+
9498
// Root directory
9599
Route::get('/', function () {
96100
if (Auth::user()) {

0 commit comments

Comments
 (0)