Giter Site home page Giter Site logo

markaren / yaj-rpc Goto Github PK

View Code? Open in Web Editor NEW
16.0 16.0 7.0 448 KB

Yet Another JSON RPC (YAJ-RPC) is a JSON RPC 2.0 implementation for JVM languages, written in Kotlin

License: MIT License

Kotlin 92.77% Java 7.23%
http json-rpc kotlin pojo tcp-ip websocket zmq

yaj-rpc's People

Contributors

gitter-badger avatar ligi avatar markaren avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

yaj-rpc's Issues

Type wrapped as string

I am having the following RPC method:

@RpcMethod
    fun account_list(): List<String> {
        println("accounts")
        return listOf("0xafb2f771f58513609765698f65d3f2f0224a956f")
    }

I would expect it to return:

{"jsonrpc":"2.0","id":43,"result":["0xafb2f771f58513609765698f65d3f2f0224a956f"]}

but it returns:

{"jsonrpc":"2.0","result":"[\"0xafb2f771f58513609765698f65d3f2f0224a956f\"]","id":43.0}

type of ID is changed

in this example the ID is changed from a int to a floating point value

โ‹Š> ~ curl --data '{"jsonrpc":"2.0","id":43,"method":"account_list","params":[]}' -H 'content-type:application/json' http://127.0.0.1:5000/                                                          17:19:35
{"jsonrpc":"2.0","result":"[{\"address\":\"afb2f771f58513609765698f65d3f2f0224a956f\",\"type\":\"account\",\"url\":\"keystore://foo\"}]","id":43.0}

method does not use '.' to separate service and method

I am currently running into:

method does not use '.' to separate service and method

caused by

val split = req.methodName!!.split("\\.".toRegex()).dropLastWhile { it.isEmpty() }.toTypedArray()
if (split.size != 2) {
    val msg = "method does not use '.' to separate service and method"
     LOG.warn(msg)
     return createErrorResponse(id, RpcError.ErrorType.INVALID_REQUEST, msg)
}

I do not find anything in the json-rpc spec: https://www.jsonrpc.org/specification that states a method name must contain a dot.

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.