golang/go

net/rpc/jsonrpc: client implementation is not compatible with JSON-RPC 1.0 spec

Open

#30,188 opened on Feb 12, 2019

View on GitHub
 (8 comments) (1 reaction) (0 assignees)Go (19,008 forks)batch import
NeedsInvestigationhelp wanted

Repository metrics

Stars
 (133,883 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

According to JSON-RPC 1.0 specification the params property should be an array of object. The canonical example of calling remote methods with JSON-RPC 1.0 is to send the parameters as one dimensional JSON array: {"method": "concat", "params": ["foo", "bar"], "id": 123} The GO's client implementation will always wrap the params property in an additional array: {"method": "concat", "params": [["foo", "bar"]], "id": 123} This works fine as long as both ends use the GO's implementation and expect the actual params to be the first element of the params array. It becomes a problem if you have another server implementation of JSON-RPC 1.0 but want to use GO's client to call remote methods.

I have worked around this issue locally by fixing it in my go fork.

Contributor guide