1
0
Fork 0
mirror of https://github.com/sourcegraph/jsonrpc2.git synced 2026-06-16 04:04:56 +02:00
No description
Find a file
Sam Herrmann c5d79b7c37 Add ability to omit params member from request
The JSON-RPC 2.0 specification allows the params member of a request to
be omitted [1]. Before this commit, this library did not allow the
params member to be omitted. When the params argument of the Conn.Call
or Conn.Notify method was set to nil, then Request.Params was set to the
JSON encoding of nil which is null.

This commit adds a ConnOption named OmitNilParams. If OmitNilParams is
applied on Conn and Conn.Call or Conn.Notify are invoked with their
params argument set to nil, then the params member in the JSON encoding
of Request is omitted. If the OmitNilParams option is not applied on
Conn then the previous behavior is maintained. In other words, the
changes in this commit are backwards compatible.

References
[1]: https://www.jsonrpc.org/specification#request_object
2023-01-18 21:03:51 -05:00
.github/workflows batch changes - update checkout v2 to v3 2023-01-03 22:03:16 +00:00
websocket fix some golangci-lint, revive linter warnings 2019-11-02 22:31:31 +02:00
.travis.yml Use the last stable Go on Travis CI (#21) 2018-08-31 09:04:50 -07:00
async.go typo in AsyncHandler docstring 2017-02-21 17:51:53 +02:00
call_opt.go Add a way to specify more non-standard-compliant fields to Request (#50) 2021-08-04 14:45:59 +02:00
call_opt_test.go Add a way to specify more non-standard-compliant fields to Request (#50) 2021-08-04 14:45:59 +02:00
codec_test.go Add PlainObjectCodec (#45) 2021-04-26 09:13:34 +02:00
conn_opt.go Add ability to omit params member from request 2023-01-18 21:03:51 -05:00
conn_opt_test.go Add ability to omit params member from request 2023-01-18 21:03:51 -05:00
go.mod support for go 1.12+ (#30) 2019-11-03 12:56:29 -08:00
go.sum add go module, simplify some cleanups 2019-11-02 21:39:58 -07:00
handler_with_error.go minor logging fixes 2019-11-07 23:44:16 +02:00
jsonrpc2.go Add ability to omit params member from request 2023-01-18 21:03:51 -05:00
jsonrpc2_test.go [#57] Fix and deprecate PlainObjectCodec (#58) 2022-07-11 15:43:39 +02:00
LICENSE initial commit 2016-10-11 15:56:18 +02:00
object_test.go Add a way to specify more non-standard-compliant fields to Request (#50) 2021-08-04 14:45:59 +02:00
README.md Added link to the godoc reference (#19) 2018-08-22 01:37:14 -07:00
stream.go [#57] Fix and deprecate PlainObjectCodec (#58) 2022-07-11 15:43:39 +02:00

jsonrpc2: JSON-RPC 2.0 implementation for Go Build Status Sourcegraph GoDoc

Package jsonrpc2 provides a Go implementation of JSON-RPC 2.0.

This package is experimental until further notice.

Open the code in Sourcegraph

Known issues

  • Batch requests and responses are not yet supported.