yoanm/symfony-jsonrpc-http-server-openapi-doc
Composer 安装命令:
composer require yoanm/symfony-jsonrpc-http-server-openapi-doc
包简介
Symfony bundle for easy JSON-RPC server OpenAPI 3.0.0 documentation
README 文档
README
Symfony bundle for easy JSON-RPC server OpenAPI 3.0.0 documentation
Symfony bundle for yoanm/jsonrpc-http-server-openapi-doc-sdk
Versions
- Symfony v3/4 - PHP >=7.1 :
^v0.X - Symfony v4/5 - PHP >=7.2 :
^v1.0 - Symfony v4.4/5.4/6.0 - PHP ^8.0 :
^v2.0 - Symfony v5.4/6.4/7.0 - PHP ^8.0 :
^v3.0
How to use
Once configured, your project is ready to handle HTTP GET request on /doc/openapi.json endpoint. Result will be a openapi compatible file.
See below how to configure it.
Configuration
Behat demo app configuration folders can be used as examples.
-
Add the bundles in your config/bundles.php file:
// config/bundles.php return [ ... Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true], Yoanm\SymfonyJsonRpcHttpServer\JsonRpcHttpServerBundle::class => ['all' => true], Yoanm\SymfonyJsonRpcHttpServerDoc\JsonRpcHttpServerDocBundle::class => ['all' => true], Yoanm\SymfonyJsonRpcHttpServerOpenAPIDoc\JsonRpcHttpServerOpenAPIDocBundle::class => ['all' => true], ... ];
-
Configure
yoanm/symfony-jsonrpc-http-serveras described on yoanm/symfony-jsonrpc-http-server documentation. -
Configure
yoanm/symfony-jsonrpc-http-server-docas described on yoanm/symfony-jsonrpc-http-server-doc documentation. -
Query your project at
/doc/openapi.jsonendpoint and you will have a OpenAPI json documentation file of your server.
Event
You are able to enhance resulting documentation by listening on json_rpc_http_server_openapi_doc.array_created event.
See below an example of listener service configuration:
method_doc_created.listener: class: Full\Namespace\DocCreatedListener # <-- replace by your class name tags: - name: 'kernel.event_listener' event: 'json_rpc_http_server_openapi_doc.array_created' method: 'enhanceMethodDoc' # <-- replace by your method name
You will receive an event of type OpenAPIDocCreatedEvent.
You can take example on Behat DocCreatedListener
Contributing
统计信息
- 总下载量: 29.45k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 2
其他信息
- 授权协议: MIT
- 更新时间: 2018-05-14