exsyst/api-doc-bundle
dev-master / 0.1.x-dev
2016-12-17 11:42 UTC
Requires
- php: ^7.0
- exsyst/swagger: ~0.2.2
- symfony/framework-bundle: ^3.2
Requires (Dev)
- api-platform/core: dev-master
- doctrine/annotations: ^1.2
- friendsofsymfony/rest-bundle: ^2.0
- nelmio/api-doc-bundle: ^2.0
- phpdocumentor/reflection-docblock: ^3.1
- phpunit/phpunit: ^5.4
- sensio/framework-extra-bundle: ^3.0
- symfony/browser-kit: ^3.2
- symfony/cache: ^3.2
- symfony/config: ^3.2
- symfony/phpunit-bridge: ^3.2
- symfony/property-access: ^3.2
- symfony/twig-bundle: ^3.2
- symfony/validator: ^3.2
- zircote/swagger-php: ^2.0
Suggests
- api-platform/core: For using an API oriented framework.
- friendsofsymfony/rest-bundle: For using the parameters annotations.
- nelmio/api-doc-bundle: For using the ApiDoc annotation.
- phpdocumentor/reflection-docblock: For parsing php docs.
- zircote/swagger-php: For using swagger annotations.
This package is auto-updated.
Last update: 2022-02-01 13:00:25 UTC
README
[WIP] 从多个来源生成 Swagger 文档
安装
就像任何bundle一样,您需要使用composer下载它
composer require exsyst/api-doc-bundle dev-master
然后将它添加到您的kernel中
class AppKernel extends Kernel { public function registerBundles() { $bundles = [ // ... new EXSyst\Bundle\ApiDocBundle\ApiDocBundle(), ]; // ... } }
这就完成了,无需配置!
此bundle是做什么的?
它通过不同的来源(称为 Describers)生成您的swagger文档。这些 Describers 针对特定的库,从中提取数据并将其合并到您的swagger文档中。
您可以在您的应用程序中获取swagger文档
$generator = $container->get('exsyst_api_doc.generator'); $swagger = $generator->generate()->toArray();
支持什么?
此bundle支持 Symfony 路由要求,PHP 注释,Swagger-Php 注释,NelmioApiDocBundle 注释,FOSRestBundle 注释和 Api-Platform 应用。
此bundle是 进行中,因此目前只支持输入文档(如果使用 Swagger-Php 或 Api-Platform,则支持输出)。
接下来是什么?
最困难的部分仍然是: 模型。我们必须构建一些东西来管理基于多个因素(序列化组、类等)变化的模型,然后将它们放入应用程序的文档中。
可能会添加其他库的支持,但优先级是首先完成此bundle。