Giter Site home page Giter Site logo

symfony-jsonrpc-api-bundle's People

Contributors

otezvikentiy avatar

Watchers

 avatar

symfony-jsonrpc-api-bundle's Issues

Fails without version?

    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"}

How to describe OpenAPI?

#[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]

Fails on v1?

    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!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.