You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
545 B

12 months ago
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class SwaggerController extends Controller
{
/**
* 返回JSON格式的Swagger定义
*/
public function getJSON()
{
11 months ago
if (config('app.debug')) {
$swagger = \OpenApi\Generator::scan([
11 months ago
app_path('Http/Controllers/Admin/'),
10 months ago
app_path('Http/Controllers/Mobile/'),
11 months ago
app_path('Http/Controllers/Controller.php')
]);
12 months ago
return response()->json($swagger, 200);
}
}
}