Skip to content

Commit b01f631

Browse files
authored
Update README.md
1 parent ea39a64 commit b01f631

File tree

1 file changed

+57
-1
lines changed

1 file changed

+57
-1
lines changed

README.md

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,65 @@
99

1010
Symfony bundle for easy JSON-RPC server documentation
1111

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+
1222
## How to use
1323

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.
1571

1672
## Contributing
1773
See [contributing note](./CONTRIBUTING.md)

0 commit comments

Comments
 (0)