mirror of
https://github.com/sourcegraph/jsonrpc2.git
synced 2026-06-19 05:30:03 +02:00
Add a way to specify more non-standard-compliant fields to Request
This change introduces `ExtraField`, a `CallOption` that can add arbitrary fields to the top-level JSON-RPC Request message. Fixes: https://github.com/sourcegraph/jsonrpc2/issues/49
This commit is contained in:
parent
5cdc7d6ccd
commit
f987817f79
5 changed files with 123 additions and 16 deletions
|
|
@ -24,7 +24,7 @@ func TestRequest_MarshalJSON_jsonrpc(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if want := `{"method":"","id":0,"jsonrpc":"2.0"}`; string(b) != want {
|
||||
if want := `{"id":0,"jsonrpc":"2.0","method":""}`; string(b) != want {
|
||||
t.Errorf("got %q, want %q", b, want)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue