Giter VIP home page Giter VIP logo

jsonrpc-server-bundle's Introduction

Latest Stable Version Total Downloads Latest Unstable Version License

Build Status Scrutinizer Code Quality Code Coverage SensioLabsInsight

JSON-RPC Server bundle

This bundle provides JSON-RPC 2.0 server ontop of the bankiru/rpc-server-bundle library.

Serialization

This bundle uses rpc.view event in order to serialize response if request was instance of JsonRpcRequestInterface and the response is not a JsonRpcResponseInterface object. You can bypass the serialization process with sending pre-created response object or implementing your own view listener

Context

This library utilizes JMS Serializer Bundle to automatically serialize non-JSON-RPC controller response to serialized view. You can specify the serialization context at the routing level. Also you could disable default context usage with with_default_context: false

Exception handling

Any unhandled exception from the controller would be automatically converted to the proper JSON-RPC failure response with INTERNAL_ERROR (-32603) code. If you want do display other error you could extend JsonRpcException class or configure it manually like following:

$exception = new JsonRpcException();
$execption->setJsonRpcError(
    new JsonRpcError(
        JsonRpcError::METHOD_NOT_FOUND,
        'Invalid method',
        (object)['debug_data' => 'some debug data']
    )
);

Specification

Refer to official JSON-RPC 2.0 specification at http://www.jsonrpc.org/specification

jsonrpc-server-bundle's People

Contributors

scaytrase avatar dimkabelkov avatar

Watchers

 avatar

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.