mirror of
https://github.com/sourcegraph/jsonrpc2.git
synced 2026-06-21 02:08:19 +02:00
support responses with null result ({"result":null})
Previously, we incorrectly interpreted these as neither a request nor a response, and we printed an error for them. This is incorrect behavior per JSON-RPC 2.0 spec; responses can have a null result.
This commit is contained in:
parent
6e06d561ec
commit
d58e8cc226
3 changed files with 34 additions and 9 deletions
|
|
@ -15,6 +15,7 @@ func TestAnyMessage(t *testing.T) {
|
|||
`{"foo":"bar"}`: {},
|
||||
`{"method":"m"}`: {request: true},
|
||||
`{"result":123}`: {response: true},
|
||||
`{"result":null}`: {response: true},
|
||||
`{"error":{"code":456,"message":"m"}}`: {response: true},
|
||||
}
|
||||
for s, want := range tests {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue