Download the PHP package ufo-tech/json-rpc-sdk-bundle without Composer
On this page you can find all versions of the php package ufo-tech/json-rpc-sdk-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ufo-tech/json-rpc-sdk-bundle
More information about ufo-tech/json-rpc-sdk-bundle
Files in ufo-tech/json-rpc-sdk-bundle
Package json-rpc-sdk-bundle
Short Description The Symfony bundle for simple usage Json-RPC api with dynamic SDK
License MIT
Homepage https://docs.ufo-tech.space/bin/view/docs/JsonRpcSdkBundle/?language=en
Informations about the package json-rpc-sdk-bundle
UFO Tech json-rpc-sdk-bundle
The Symfony bundle for simple usage Json-RPC. And automatically generation SDK from server for Symfony v.6.*
Read the Documentations
About this package
Package for easy api creation SDK and DTO for json-rpc server
Environmental requirements
What's new?
Version 1.1
- Generation of DTO for the api response under the condition of using the ufo-tech/json-rpc-bundle library on the server side and configuring the server response
Getting Started
Automatic package installation in Symfony
Step 0 (RECOMMENDED): Configure Composer
In order for your Symfony Flex to automatically make all the necessary settings when you add a package, you need to make the following changes to your composer.json
More about Symfony Flex in doc
Step 1: Installation
From the console in the project folder, run this command to download the latest version of this package:
Step 2: Register the package
Make sure that the bundle is automatically registered in your project's `config/bundles.php' file:
Step 3: Adding parameters
In you can configure generator, to automatically regenerate SDK when server change methods
Here is example with explanation:
.ENV
You can pass tokens to access the provider api via environment variables
Step 4: Generate SDK
You have two options for generating SDK:
- Make SDK for one vendor from JsonRPC server.
- Generate SDK for every vendor-URL from config file
For single SDK You have to execute with
- vendor (required)
- RPC endpoint url (required)
- Token name (optional)
- Token value (optional)
Example:
For batch generating just run without arguments (arguments will be passed from config)
Done! You have generated SDK.
:warning: NOTE!
RPC server answer will be cached for 1 HOUR. If you need to clear it and request api again, run:
Step 5: Usage of SDK
After generating you are ready to use your SDK.
Here is example of generated SDK.
App\Sdk\Test\PingProcedure
Brilliant. Now let's use it. It is as simple as possible. In your Controllers/Procedures/Commands/e.t.c You just have to call your SDK method from your SDK and pass any required parameters. Like that
Step 6: Profit
When you call your method, this package will make RPC request with configured token, to your server with all parameters, than handle response, under the hood and return you just data which you can use. This lib working like a bridge between your code and remote RPC code just like you use it local.
All versions of json-rpc-sdk-bundle with dependencies
symfony/framework-bundle Version >=6.4
symfony/serializer Version >=6.4
ufo-tech/json-rpc-client-sdk Version ^3.2
symfony/console Version >=6.4
symfony/http-kernel Version >=6.4