terwey/slim-swagger
最新稳定版本:0.0.3
Composer 安装命令:
composer require terwey/slim-swagger
包简介
Slim Middleware for generating Swagger documentation on the fly with Swagger-PHP
README 文档
README
A Slim Middleware for generating Swagger documentation on the fly with Swagger-PHP.
Installation
Easiest is using Composer:
composer require terwey/slim-swagger
Adding it to Slim is easy too:
$app->add(new \terwey\SlimSwagger(array(), array('baseDir' => __DIR__.'/../src/')));
Where src/ is the directory you keep your API endpoint or Models.
Resources
For now you'll have to grab a release of Swagger-UI and copy /lib and /css to your /public directory.
Also copy over swagger-ui.min.js to the /public/lib directory.
Template
I've provided a Twig template in the /templates directory. Copy this over to your Slim application. If you want to use Twig also install Slim Views.
Docs
The SlimSwagger class takes 2 parameters. The first one is the $swaggerSettings array, please see the Swagger-PHP docs for more info.
$swaggerSettings = array(
'output' => 'json',
'apiVersion' => $defaultApiVersion,
'swaggerVersion' => $defaultSwaggerVersion,
'defaultSwaggerVersion' => $resourceList['swaggerVersion'],
'defaultBasePath' => $defaultBasePath
);
The second one is the $options array.
$options = array(
'baseDir' => __DIR__.'/../',
'ignoreDir' => array()
);
统计信息
- 总下载量: 535
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 16
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-01-24