mirror of
https://github.com/sourcegraph/jsonrpc2.git
synced 2026-06-16 04:04:56 +02:00
No description
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 sending a request. When the params argument of the Conn.Call/Conn.DispatchCall 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 CallOption named OmitNilParams. If OmitNilParams is used when sending a request with params set to nil, then the params member in the JSON encoding of Request is omitted. If the OmitNilParams option is not used 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 |
||
|---|---|---|
| .github/workflows | ||
| websocket | ||
| .travis.yml | ||
| async.go | ||
| call_opt.go | ||
| call_opt_test.go | ||
| codec_test.go | ||
| conn_opt.go | ||
| conn_opt_test.go | ||
| go.mod | ||
| go.sum | ||
| handler_with_error.go | ||
| jsonrpc2.go | ||
| jsonrpc2_test.go | ||
| LICENSE | ||
| object_test.go | ||
| README.md | ||
| stream.go | ||
jsonrpc2: JSON-RPC 2.0 implementation for Go

Package jsonrpc2 provides a Go implementation of JSON-RPC 2.0.
This package is experimental until further notice.
Known issues
- Batch requests and responses are not yet supported.