PHP code example of westhack / think-swagger

1. Go to this page and download the library: Download westhack/think-swagger library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

westhack / think-swagger example snippets


    "autoload": {
           "psr-4": {
               "westhack\\swagger\\": "vendor/westhack/think-swagger/src"
           },
           "files": [
               "vendor/westhack/think-swagger/src/route.php"
           ]
       },

    php think swaggerAssetRegister   ## 默认资源目录
    php think swaggerAssetRegister --path /public/static   ## 绝对路径
    php think swaggerAssetRegister --path swagger/ui   ## 默认资源目录下面的路径
  

    http://你的域名/index.php?s=swagger ## swagger ui
    http://你的域名/index.php?s=swagger/api ##  swagger json
    http://你的域名/index.php?s=swagger/api&clear-cache ## 清除缓存(如果开启缓存)