You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -24,12 +25,13 @@ See [yoanm/symfony-jsonrpc-http-server-doc](https://github.com/yoanm/symfony-jso
24
25
25
26
## Versions
26
27
27
-
- Symfony v3/4 - PHP >=7.1 : `^2.0`
28
+
* Symfony v3/4 - PHP >=7.1 : `^2.0`
29
+
30
+
⚠️⚠️ `v2.1.0` and `v2.1.1` were badly taggued, used `v3.0.0` instead ! ⚠️⚠️
28
31
29
-
⚠️⚠️ `v2.1.0` and `v2.1.1` were badly taggued, used `v3.0.0` instead ! ⚠️⚠️
32
+
* Symfony v4/5 - PHP >=7.2 : `~3.0.0`
30
33
31
-
- Symfony v4/5 - PHP >=7.2 : `~3.0.0`
32
-
- Symfony v4/5 - PHP >=7.3 : `^3.1`
34
+
* Symfony v4/5 - PHP >=7.3 : `^3.1`
33
35
34
36
## How to use
35
37
@@ -39,45 +41,48 @@ See below how to configure it.
39
41
40
42
## Configuration
41
43
42
-
Bundle requires only one thing :
43
-
- JSON-RPC Methods which are compatible with [`yoanm/jsonrpc-server-sdk`](https://raw.githubusercontent.com/yoanm/php-jsonrpc-server-sdk)
44
-
44
+
Bundle requires only one thing :
45
+
46
+
* JSON-RPC Methods which are compatible with [`yoanm/jsonrpc-server-sdk`](https://raw.githubusercontent.com/yoanm/php-jsonrpc-server-sdk)
47
+
45
48
It comes with [built-in method resolver](./src/Resolver/MethodResolver.php) which use a [service locator](https://symfony.com/doc/3.4/service_container/service_subscribers_locators.html#defining-a-service-locator). Using a service locator allow to load (and so instanciate dependencies, dependencies of dependencies, etc) method only when required (usually only one method is required by request, except for batch requests which will load one or more methods).
46
-
49
+
47
50
*[Behat demo app configuration folders](./features/demo_app/) can be used as examples.*
48
51
49
-
- Add the bundles in your `config/bundles.php` file:
# Or the following in case you want to customize endpoint path
78
+
#json_rpc_http_server:
79
+
# endpoint: '/my-custom-endpoint' # Default to '/json-rpc'
80
+
```
78
81
79
82
### JSON-RPC Method mapping
83
+
80
84
In order to inject yours JSON-RPC method into the server add the tag `json_rpc_http_server.jsonrpc_method` and the key/value `method` like following example :
85
+
81
86
```yaml
82
87
services:
83
88
method-a.service-id:
@@ -88,6 +93,7 @@ services:
88
93
```
89
94
90
95
### Methods mapping aware
96
+
91
97
In case you want to be aware of which methods are registered inside the JSON-RPC server, you can use the `json_rpc_http_server.method_aware`. Your class must implements `JsonRpcMethodAwareInterface`.
0 commit comments