PHPackages                             mops1k/json-rpc-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. mops1k/json-rpc-bundle

ActiveSymfony-bundle[Parsing &amp; Serialization](/categories/parsing)

mops1k/json-rpc-bundle
======================

This bundle provide an easy way to implement json-rpc server with fully specification supporting.

0.1.3(1y ago)17MITPHPPHP &gt;=8.3

Since Jun 22Pushed 1y ago1 watchersCompare

[ Source](https://github.com/mops1k/json-rpc-bundle)[ Packagist](https://packagist.org/packages/mops1k/json-rpc-bundle)[ RSS](/packages/mops1k-json-rpc-bundle/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (6)Dependencies (13)Versions (7)Used By (0)

JSON-RPC Server bundle
======================

[](#json-rpc-server-bundle)

This bundle provide an easy way to implement json-rpc server with fully specification supporting. Bundle supports multiple procedure calls in one request as described in specification.

[JSON-RPC](https://www.jsonrpc.org/specification) specification is fully compatible with [CQRS](https://en.wikipedia.org/wiki/Command_Query_Responsibility_Segregation) architecture

Install
-------

[](#install)

```
composer require mops1k/json-rpc-bundle
```

Import route declaration in your routes:

```
#config/routes/json-rpc.yaml
app_file:
    # loads routes from the given routing file stored in some bundle
    resource: '@JsonRpcBundle/Resources/config/routing/json-rpc-bundle.yaml'
```

Or add your own paths by template:

```
json_rpc_entrypoint:
    path: '/path/to/rpc'
    methods: 'POST'
    controller: 'JsonRpcBundle\Controller\JsonRpcController'

json_rpc_namespace_entrypoint:
    path: '/path/to/rpc/{namespace}'
    methods: 'POST'
    controller: 'JsonRpcBundle\Controller\JsonRpcController'
```

Usage
-----

[](#usage)

To create method you have to create invokable class with attribute [`\JsonRpcBundle\Attribute\AsRpcMethod`](./src/Attribute/AsRpcMethod.php), where `methodName` constructor parameter must contain method name. Example:

```
