From 5e77f58c6f449486526e448787961ec7039531b5 Mon Sep 17 00:00:00 2001 From: HafizMMoaz Date: Fri, 17 Jul 2026 20:44:01 +0500 Subject: [PATCH] Register scoped API docs at /docs/taskly via Scramble --- src/Providers/TasklyServiceProvider.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/Providers/TasklyServiceProvider.php b/src/Providers/TasklyServiceProvider.php index abdae74..bcde66b 100644 --- a/src/Providers/TasklyServiceProvider.php +++ b/src/Providers/TasklyServiceProvider.php @@ -16,7 +16,17 @@ public function boot(): void if (file_exists($apiRoutesPath)) { $this->loadRoutesFrom($apiRoutesPath); } - + + // Scoped Swagger/OpenAPI docs for this module at /docs/taskly. + // Guarded so the package still works if the host app has no Scramble. + if (class_exists(\Dedoc\Scramble\Scramble::class)) { + \Dedoc\Scramble\Scramble::registerApi('taskly', [ + 'api_path' => 'api/taskly', + 'info' => ['version' => \Composer\InstalledVersions::getPrettyVersion('zerp/taskly') ?? '1.0.0', 'description' => 'Zerp Taskly (projects & tasks) module REST API for mobile and third-party clients.'], + 'ui' => ['title' => 'Zerp Taskly API'], + ])->expose(ui: '/docs/taskly', document: '/docs/taskly.json'); + } + $migrationsPath = __DIR__.'/../Database/Migrations'; if (is_dir($migrationsPath)) { $this->loadMigrationsFrom($migrationsPath);