apoelstra / rust-jsonrpc

Rust JSONRPC library
Creative Commons Zero v1.0 Universal
158 stars 62 forks source link

Support params as Object #107

Closed RCasatta closed 10 months ago

RCasatta commented 11 months ago

This lib is accepting only arrays as params:

https://github.com/apoelstra/rust-jsonrpc/blob/b8c3f0d4d78440a286dd1fa7e97d6f78520b16b6/src/lib.rs#L73

I think because that was the only way available to communicate with core. However, now there are named parameters and to support those this library should supportalso json objects as params.

Indeed jsonrpc spec https://www.jsonrpc.org/specification#request_object allows it to be an array or an object

dpc commented 11 months ago

Notably:

This member MAY be omitted.

And I think null is also possible.