Ian*_*ato 1 php laravel swagger
我已经使用带有 DarkaOnLine/L5-Swagger 包的 Swagger 安装了 laravel 5.6,我已经按照安装说明进行了操作
php作曲家需要“darkaonline/l5-swagger:5.6.*”
php artisan vendor:publish --provider "L5Swagger\L5SwaggerServiceProvider"
我也设置了
L5_SWAGGER_GENERATE_ALWAYS=真
在我的环境中创建了一个控制器并添加了
/**
* @SWG\Swagger(
* schemes={"http","https"},
* host="api.host.com",
* basePath="/",
* @SWG\Info(
* version="1.0.0",
* title="This is my website cool API",
* description="Api description...",
* termsOfService="",
* @SWG\Contact(
* email="contact@mysite.com"
* ),
* @SWG\License(
* name="Private License",
* url="URL to the license"
* )
* ),
* @SWG\ExternalDocumentation(
* description="Find out more about my website",
* url="http..."
* )
* )
*/
Run Code Online (Sandbox Code Playgroud)
之后我打字
php artisan l5-swagger:generate
php artisan vendor:publish
Run Code Online (Sandbox Code Playgroud)
当我访问 /api/documentation 时出现白屏,在控制台中出现以下错误
您的帮助将不胜感激。
小智 6
我已经按步骤解决了这个问题:
刚刚从供应商文件夹中复制文件并添加到特定路径中。
从以下位置复制所有文件:laravel-yourapp\vendor\swagger-api\swagger-ui\dist
然后将所有文件粘贴到路径中:laravel-yourapp\public\docs\asset
归档时间: |
|
查看次数: |
4972 次 |
最近记录: |