JsonRpcBundle

Last modified by Ashterix on 2024/07/11 13:11

Current Version  https://img.shields.io/github/v/tag/ufo-tech/json-rpc-bundle?color=blue&label=&logo=Packagist&logoColor=white&labelColor=7b8185
 Category  Api
 Type  Symfony Bundle
 Dependencies https://img.shields.io/packagist/dependency-v/ufo-tech/json-rpc-bundle/php?logo=PHP&logoColor=white
https://img.shields.io/packagist/dependency-v/ufo-tech/json-rpc-bundle/symfony/framework-bundle?label=Symfony&logo=Symfony&logoColor=white
https://img.shields.io/packagist/dependency-v/ufo-tech/json-rpc-bundle/symfony/serializer?label=SymfonySerializer&logo=Symfony&logoColor=white
https://img.shields.io/packagist/dependency-v/ufo-tech/json-rpc-bundle/symfony/serializer?label=SymfonyCache&logo=Symfony&logoColor=white
 Size  https://img.shields.io/github/repo-size/ufo-tech/json-rpc-bundle?label=Size%20of%20the%20repository
 License  https://img.shields.io/badge/license-MIT-green?labelColor=7b8185

Package for Easy Creation of API via JSON-RPC Server

Creating RPC services for service-oriented architecture on Symfony has never been easier.

This package makes it easy to create an API using a JSON-RPC server for Symfony v.6.* and later. It is suitable for developers who want to quickly and efficiently integrate RPC functionality into their projects

Key Benefits

  • Ease of Integration: Integrating this package into your project is extremely straightforward. You simply need to add a special interface to any existing class, and it will automatically gain the capability to handle JSON-RPC requests.
  • Flexibility: The package provides great flexibility in API creation, allowing developers to easily extend and modify server behavior without interfering with existing code.
  • Efficiency: Thanks to the optimization of calls and the use of modern Symfony components, the package guarantees high performance when processing requests.

Changes in 7.0

General Changes

Configuration

WARNING!!! The configuration has undergone significant changes and is not backward compatible with version 6. See the updated documentation

  • In the security block, HTTP methods are no longer protected; actions (API calls and documentation separately) are protected instead.
  • The docs block no longer includes the response block; instead, all properties are now located at its level.
  • Deprecated parameters have been removed (docs.response.json_schema).
  • New parameters added to the docs block that are used in building the API documentation:
    • project_name
    • project_description
    • project_version

Functionality Provided by the Library

After installation, you immediately get:

  • An entry point for your Json-RPC API that can accept both synchronous and asynchronous requests
  • Automatic generation of API capability documentation in json format (see Bundle Configuration)
  • The ability to subscribe to RPC server lifecycle events (see Lifecycle Events)
  • Batch requests with the ability to use elements of one request's response in the body of another request in the same series (see Batch Requests)
  • Requests with a response to a webhook or web-socket
  • Caching of method responses that have relatively static results (see #[RPC\Cache])

Documentation sections

You can find detailed information about every aspect of using and configuring the library in