Skip to content

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

Description

@stefangluszek

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.help wanted

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions