otezvikentiy / symfony-jsonrpc-api-bundle Goto Github PK
View Code? Open in Web Editor NEWSymfony Json RPC Bundle
Home Page: https://otezvikentiy.tech
License: MIT License
Symfony Json RPC Bundle
Home Page: https://otezvikentiy.tech
License: MIT License
App\JsonRpcController\:
resource: '../src/JsonRpcController/{*Method.php}'
tags:
- { name: ov.rpc.method, namespace: App\JsonRpcController\ }
<?php
declare(strict_types=1);
namespace App\JsonRpcController;
use App\Dto\EchoDto;
use OV\JsonRPCAPIBundle\Core\Annotation\JsonRPCAPI;
#[JsonRPCAPI(methodName: 'productEcho', type: 'POST')]
class JsonRpcProductEchoMethod
{
public function call(EchoDto $dto): EchoDto
{
return $dto;
}
}
{"jsonrpc":"2.0","error":{"code":0,"message":"App\\JsonRpcController\\JsonRpcProductEchoMethod::call(): Argument #1 ($dto) must be of type App\\Dto\\EchoDto, null given, called in \/vendor\/otezvikentiy\/json-rpc-api\/src\/Controller\/ApiController.php on line 133"},"id":"1"}
#[JsonRPCAPI(methodName: 'product.echo', type: 'POST')]
class JsonRpcProductEchoMethod
{
public function call(EchoDto $dto): EchoDto
{
return $dto;
}
}
produces unexpected echoRequest
and echoMainRequest
schemas
product.echoRequest:
type: object
properties: { }
required: { }
product.echoMainRequest:
type: object
properties: { jsonrpc: { type: string, format: '', default: '2.0', example: '2.0' }, method: { type: string, format: '', default: product.echo, example: product.echo }, params: { $ref: '#/components/schemas/product.echoRequest' } }
required: [jsonrpc, method, params]
EchoDtoResponse:
type: object
properties: { jsonrpc: { type: string, format: '', default: '2.0', example: '2.0' }, tenant: { type: string, format: '', default: '', example: '' }, product: { type: App\Dto\ProductDto, format: '', default: '', example: '' } }
required: [jsonrpc, tenant, product]
App\JsonRpcController\:
resource: '../src/JsonRpcController/v1/{*Method.php}'
tags:
- { name: ov.rpc.method, namespace: App\JsonRpcController\v1\, version: 1 }
<?php
declare(strict_types=1);
namespace App\JsonRpcController\v1;
use App\Dto\EchoDto;
use OV\JsonRPCAPIBundle\Core\Annotation\JsonRPCAPI;
#[JsonRPCAPI(methodName: 'productEcho', type: 'POST')]
class JsonRpcProductEchoMethod
{
public function call(EchoDto $dto): EchoDto
{
return $dto;
}
}
Expected to find classApp\JsonRpcController\JsonRpcProductEchoMethod in file jsonrpc/src/JsonRpcController/v1/JsonRpcProductEchoMethod.php while importing services from resource ../src/JsonRpcController/v1/{*Method.php}, but it was not found!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.