laravel5.5 配置 swagger Failed to load Api definition 的問題

laravel5.5 配置 swagger

  • 參考 http://packagist.p2hp.com/packages/darkaonline/l5-swagger , 按照該頁面進行配置, 結果出現如下報錯:
    在這裏插入圖片描述

解決辦法:

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="[email protected]"
 *         ),
 *         @SWG\License(
 *             name="Private License",
 *             url="URL to the license"
 *         )
 *     ),
 *     @SWG\ExternalDocumentation(
 *         description="Find out more about my website",
 *         url="http..."
 *     )
 * )
 */
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章