|
9 | 9 |
|
10 | 10 | Symfony bundle for easy JSON-RPC server documentation |
11 | 11 |
|
| 12 | +Symfony bundle for [`yoanm/jsonrpc-server-doc-sdk`](https://raw.githubusercontent.com/yoanm/php-jsonrpc-server-doc-sdk) |
| 13 | + |
| 14 | +See [yoanm/symfony-jsonrpc-params-sf-constraints-doc](https://github.com/yoanm/symfony-jsonrpc-params-sf-constraints-doc) for params documentation generation. |
| 15 | + |
| 16 | +## Availble formats |
| 17 | + |
| 18 | + - Raw : Built-in `json` format at `/doc` or `/doc/raw.json` |
| 19 | + - Swagger : [yoanm/symfony-jsonrpc-http-server-swagger-doc](https://github.com/yoanm/symfony-jsonrpc-http-server-swagger-doc) |
| 20 | + - OpenApi : [yoanm/symfony-jsonrpc-http-server-openapi-doc](https://github.com/yoanm/symfony-jsonrpc-http-server-openapi-doc) |
| 21 | + |
12 | 22 | ## How to use |
13 | 23 |
|
14 | | - |
| 24 | +Once configured, your project is ready to handle HTTP `GET` request on `/doc/{?filename}` endpoint. |
| 25 | + |
| 26 | +See below how to configure it. |
| 27 | + |
| 28 | +## Configuration |
| 29 | + |
| 30 | +*[Behat demo app configuration folders](./features/demo_app/) can be used as examples.* |
| 31 | + |
| 32 | + - Add the bundles in your `config/bundles.php` file: |
| 33 | + ```php |
| 34 | + // config/bundles.php |
| 35 | + return [ |
| 36 | + ... |
| 37 | + Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true], |
| 38 | + Yoanm\SymfonyJsonRpcHttpServer\JsonRpcHttpServerBundle::class => ['all' => true], |
| 39 | + Yoanm\SymfonyJsonRpcHttpServerDoc\JsonRpcHttpServerDocBundle::class => ['all' => true], |
| 40 | + ... |
| 41 | + ]; |
| 42 | + ``` |
| 43 | + |
| 44 | + - Add the following in your routing configuration : |
| 45 | + ```yaml |
| 46 | + # config/routes.yaml |
| 47 | + json-rpc-endpoint: |
| 48 | + resource: '@JsonRpcHttpServerBundle/Resources/config/routing/endpoint.xml' |
| 49 | + |
| 50 | + json-rpc-endpoint-doc: |
| 51 | + resource: '@JsonRpcHttpServerDocBundle/Resources/config/routing/endpoint.xml' |
| 52 | + ``` |
| 53 | + |
| 54 | + - Add the following in your configuration : |
| 55 | + ```yaml |
| 56 | + # config/config.yaml |
| 57 | + framework: |
| 58 | + secret: '%env(APP_SECRET)%' |
| 59 | + |
| 60 | + json_rpc_http_server: ~ |
| 61 | + |
| 62 | + json_rpc_http_server_doc: ~ |
| 63 | + # Or the following in case you want to customize endpoint path |
| 64 | + #json_rpc_http_server_doc: |
| 65 | + # endpoint: '/my-custom-doc-endpoint' # Default to '/doc' |
| 66 | + ``` |
| 67 | + |
| 68 | + - Register JSON-RPC methods as described on [yoanm/symfony-jsonrpc-http-server](https://github.com/yoanm/symfony-jsonrpc-http-server) documentation. |
| 69 | + |
| 70 | + - Query your project at `/doc` endpoint and you will have a `json` documentation of your server. |
15 | 71 |
|
16 | 72 | ## Contributing |
17 | 73 | See [contributing note](./CONTRIBUTING.md) |
0 commit comments