thomaseizinger/rust-jsonrpc-client

Allow users to specify a `Params` object instead of individual parameters

thomaseizinger opened this issue · 2 comments

If the RPC method has a single parameters called params, we should take that and serialize directly instead of stuffing it into an array / object.

This would give great flexibility to users in how the parameters are serialized.

Also evaluate other heuristics for how we could detect that. Possible an attribute?

Something that might relate to this is how, right now, you cannot have v2 params that are an array (see here ) , though the JsonRPC v2 spec allows this: https://www.jsonrpc.org/specification#examples

Should I open a new ticket for this, or am I missing how to do this? I ran into it when a server using v2 expected an array for params

Something that might relate to this is how, right now, you cannot have v2 params that are an array (see here ) , though the JsonRPC v2 spec allows this: jsonrpc.org/specification#examples

Yes that is a known limitation. Not sure what the best way of achieving this combination is.