欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

laravel5.5 配置 swagger Failed to load Api definition 的问题

程序员文章站 2022-06-15 15:38:23
...

laravel5.5 配置 swagger

  • 参考 http://packagist.p2hp.com/packages/darkaonline/l5-swagger , 按照该页面进行配置, 结果出现如下报错:
    laravel5.5 配置 swagger Failed to load Api definition 的问题

解决办法:

Controller.php 添加如**释

/**
 * @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="aaa@qq.com"
 *         ),
 *         @SWG\License(
 *             name="Private License",
 *             url="URL to the license"
 *         )
 *     ),
 *     @SWG\ExternalDocumentation(
 *         description="Find out more about my website",
 *         url="http..."
 *     )
 * )
 */
相关标签: laravel swagger