v3knet / swagger-module
此包的最新版本(0.2.0)没有提供许可信息。
0.2.0
2015-09-27 22:52 UTC
Requires
- php: >=5.5
- bernard/bernard: 1.0.*@dev
- dflydev/doctrine-orm-service-provider: ^2.0.0
- doctrine/cache: ^1.4.1
- doctrine/orm: ^2.5.0
- guzzlehttp/guzzle: ^6.0.2
- jms/serializer: ^1.0
- monolog/monolog: ^1.16.0
- phpdocumentor/reflection-docblock: ^2.0
- psr/log: ^1.0.0
- silex/silex: 2.0.x-dev
- swiftmailer/swiftmailer: ^5.4.1
- symfony/config: ^2.7.0
- symfony/console: ^2.7.0
- symfony/dependency-injection: ^2.7.0
- symfony/form: ^2.7.0
- symfony/security: ^2.7.0
- symfony/security-csrf: ^2.7.0
- symfony/serializer: ^2.7.0
- symfony/translation: ^2.7.0
- symfony/twig-bridge: ^2.7
- symfony/validator: ^2.7.0
- symfony/var-dumper: ^2.7.0
- symfony/yaml: ^2.7.0
- twig/twig: ^1.18
Requires (Dev)
- silex/web-profiler: 2.0.x-dev
- symfony/var-dumper: ^2.7.0
Suggests
- silex/web-profiler: silex/web-profiler 2.0.x-dev
README
此模块提供(1)位于 /swagger 的 Swagger UI 和(2)自动生成 /swagger.json
文件。
示例
定义 Swagger 注释,模块将将其添加到 swagger.json
响应中。
namespace my_module\controllers; use vendor_name\project_name\system\controllers\BaseController; use vendor_name\project_name\swagger\annotations as Swagger; class HelloController extends BaseController { /** * @Swagger\Param(name="name", in="path") * @Swagger\Response("Hello") */ public function actionGet($name) { return $this->json(new Hello($name)); } }