filecoin-project / filecoin-project/go-jsonrpc

Cannot parse non-numerical ID

Open
#28 10 comments 1 reaction 0 assignees View on GitHub
Dominant language
Go
Stars
100
Forks
95
PR merge metrics
No merged PRs in 30d

Description

Per the json-rpc spec, the `"Id"` in the request can be a number, a string or NULL, but this library throws an error when using a string:

```
{
"jsonrpc": "2.0",
"id": 0,
"error": {
"code": -32700,
"message": "unmarshaling request: json: cannot unmarshal string into Go struct field request.id of type int64"
}
}
```

Additionally, the response breaks the spec too because `If there was an error in detecting the id in the Request object (e.g. Parse error/Invalid Request), it MUST be Null.`.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.